|
Cataclysm BN
|
#include <item.h>
Classes | |
| class | craft_data |
| Data for items that represent in-progress crafts. More... | |
| struct | default_charges_tag |
| Suppress randomization and always start with default quantity of charges. More... | |
| struct | solitary_tag |
| Default (or randomized) charges except if counted by charges then only one charge. More... | |
| struct | sound_data |
Public Types | |
| using | FlagsSetType = cata::flat_set< std::string > |
| using | archive_type_tag = io::object_archive_tag |
Public Member Functions | |
| item () | |
| item (item &&) | |
| item (const item &) | |
| item & | operator= (item &&) |
| item & | operator= (const item &) |
| item (const itype_id &id, time_point turn=calendar::turn, int qty=-1) | |
| item (const itype *type, time_point turn=calendar::turn, int qty=-1) | |
| item (const itype_id &id, time_point turn, default_charges_tag) | |
| item (const itype *type, time_point turn, default_charges_tag) | |
| item (const itype_id &id, time_point turn, solitary_tag) | |
| item (const itype *type, time_point turn, solitary_tag) | |
| item (const recipe *rec, int qty, std::list< item > items, std::vector< item_comp > selections) | |
| For constructing in-progress crafts. More... | |
| template<typename... Args> | |
| item (const std::string &itype, Args &&... args) | |
| ~item () | |
| safe_reference< item > | get_safe_reference () |
| Return a pointer-like type that's automatically invalidated if this item is destroyed or assigned-to. More... | |
| item & | convert (const itype_id &new_type) |
| Filter converting this instance to another type preserving all other aspects. More... | |
| item & | deactivate (const Character *ch=nullptr, bool alert=true) |
| Filter converting this instance to the inactive type If the item is either inactive or cannot be deactivated is a no-op. More... | |
| item & | activate () |
| Filter converting instance to active state. More... | |
| units::energy | mod_energy (const units::energy &qty) |
| Add or remove energy from a battery. More... | |
| item & | ammo_set (const itype_id &ammo, int qty=-1) |
| Filter setting the ammo for this instance Any existing ammo is removed. More... | |
| item & | ammo_unset () |
| Filter removing all ammo from this instance If the item is neither a tool, gun nor magazine is a no-op For items reloading using magazines any empty magazine remains present. More... | |
| item & | set_damage (int qty) |
| Filter setting damage constrained by min_damage and max_damage. More... | |
| item | split (int qty) |
| Splits a count-by-charges item always leaving source item with minimum of 1 charge. More... | |
| const mtype * | get_mtype () const |
| void | set_mtype (const mtype *m) |
| Sets the monster type associated with this item (corpse). More... | |
| bool | is_corpse () const |
| Whether this is a corpse item. More... | |
| bool | can_revive () const |
| Whether this is a corpse that can be revived. More... | |
| bool | ready_to_revive (const tripoint &pos) const |
| Whether this corpse should revive now. More... | |
| bool | is_money () const |
| nc_color | color () const |
| Returns the default color of the item (e.g. More... | |
| nc_color | color_in_inventory () const |
| Returns the color of the item depending on usefulness for the player character, e.g. More... | |
| nc_color | color_in_inventory (const player &p) const |
| Returns the color of the item depending on usefulness for the passed player, e.g. More... | |
| std::string | tname (unsigned int quantity=1, bool with_prefix=true, unsigned int truncate=0) const |
| Return the (translated) item name. More... | |
| std::string | display_money (unsigned int quantity, unsigned int total, const std::optional< unsigned int > &selected=std::nullopt) const |
| std::string | display_name (unsigned int quantity=1) const |
| Returns the item name and the charges or contained charges (if the item can have charges at all). More... | |
| std::vector< iteminfo > | info () const |
| Return all the information about the item and its type as a vector. More... | |
| std::vector< iteminfo > | info (int batch) const |
| std::vector< iteminfo > | info (const iteminfo_query &parts, int batch, temperature_flag temperature) const |
| std::vector< iteminfo > | info (temperature_flag temperature) const |
| std::string | info_string () const |
| As info, but as a string rather than a vector of properties. More... | |
| std::string | info_string (const iteminfo_query &parts, int batch=1, temperature_flag temperature=temperature_flag::TEMP_NORMAL) const |
| void | basic_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | med_info (const item *med_item, std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | food_info (const item *food_item, std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug, temperature_flag temperature) const |
| void | magazine_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | ammo_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | gun_info (const item *mod, std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | gunmod_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | armor_protection_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | armor_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | animal_armor_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | armor_fit_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | book_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | battery_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | container_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | tool_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | component_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | repair_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | disassembly_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | qualities_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | bionic_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | combat_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | contents_info (std::vector< iteminfo > &info, const iteminfo_query *parts, int batch, bool debug) const |
| void | final_info (std::vector< iteminfo > &info, const iteminfo_query &parts, int batch, bool debug) const |
| float | simulate_burn (fire_data &frd) const |
| Calculate all burning calculations, but don't actually apply them to item. More... | |
| bool | burn (fire_data &frd) |
| Burns the item. More... | |
| const item_category & | get_category () const |
| bool | reload (player &u, item_location loc, int qty) |
| Reload item using ammo from location returning true if successful. More... | |
| template<typename Archive > | |
| void | io (Archive &) |
| void | serialize (JsonOut &json) const |
| void | deserialize (JsonIn &jsin) |
| const std::string & | symbol () const |
| int | price (bool practical) const |
| Returns the monetary value of an item. More... | |
| bool | display_stacked_with (const item &rhs, bool check_components=false) const |
| Whether two items should stack when displayed in a inventory menu. More... | |
| bool | stacks_with (const item &rhs, bool check_components=false, bool skip_type_check=false) const |
| bool | merge_charges (const item &rhs) |
| Merge charges of the other item into this item. More... | |
| units::mass | weight (bool include_contents=true, bool integral=false) const |
| units::volume | volume (bool integral=false) const |
| Total volume of an item accounting for all contained/integrated items NOTE: Result is rounded up to next nearest milliliter when working with stackable (count_by_charges) items that have fractional volume per charge. More... | |
| units::volume | base_volume () const |
| Simplified, faster volume check for when processing time is important and exact volume is not. More... | |
| units::volume | corpse_volume (const mtype *corpse) const |
| Volume check for corpses, helper for base_volume(). More... | |
| int | lift_strength () const |
| Required strength to be able to successfully lift the item unaided by equipment. More... | |
Melee | |
The functions here assume the item is used in melee, even if's a gun or not a weapon at all. Because the functions apply to all types of items, several of the is_* functions here may return true for the same item. This only indicates that it can be used in various ways. | |
| int | attack_cost () const |
| Base number of moves (Creature::moves) that a single melee attack with this items takes. More... | |
| int | damage_melee (damage_type dt) const |
| Damage of given type caused when this item is used as melee weapon. More... | |
| damage_instance | base_damage_melee () const |
| All damage types this item deals when used in melee (no skill modifiers etc. More... | |
| damage_instance | base_damage_thrown () const |
| All damage types this item deals when thrown (no skill modifiers etc. More... | |
| double | effective_dps (const player &guy, const monster &mon) const |
| Calculate the item's effective damage per second past armor when wielded by a character against a monster. More... | |
| std::map< std::string, double > | dps (bool for_display, bool for_calc, const player &guy) const |
| calculate effective dps against a stock set of monsters. More... | |
| std::map< std::string, double > | dps (bool for_display, bool for_calc) const |
| double | average_dps (const player &guy) const |
| return the average dps of the weapon against evaluation monsters More... | |
| double | ideal_ranged_dps (const Character &who, gun_mode &mode) const |
| bool | is_two_handed (const Character &guy) const |
| Whether the character needs both hands to wield this item. More... | |
| bool | is_melee (damage_type dt) const |
| Is this item an effective melee weapon for the given damage type? More... | |
| bool | is_melee () const |
| Is this item an effective melee weapon for any damage type? More... | |
| skill_id | melee_skill () const |
| The most relevant skill used with this melee weapon. More... | |
| int | reach_range (const Character &guy) const |
| Max range of melee attack this weapon can be used for. More... | |
| void | set_countdown (int num_turns) |
| Sets time until activation for an item that will self-activate in the future. More... | |
| bool | use_charges (const itype_id &what, int &qty, std::list< item > &used, const tripoint &pos, const std::function< bool(const item &)> &filter=return_true< item >) |
| Consumes specified charges (or fewer) from this and any contained items. More... | |
| bool | on_drop (const tripoint &pos) |
| Invokes item type's itype::drop_action. More... | |
| bool | on_drop (const tripoint &pos, map &map) |
| Invokes item type's itype::drop_action. More... | |
| bool | use_amount (const itype_id &it, int &quantity, std::list< item > &used, const std::function< bool(const item &)> &filter=return_true< item >) |
| Consume a specific amount of items of a specific type. More... | |
| bool | allow_crafting_component () const |
| Permits filthy components, should only be used as a helper in creating filters. More... | |
Containers | |
Containers come in two flavors:
| |
| bool | is_container () const |
| Whether this is container. More... | |
| bool | is_watertight_container () const |
| Whether this is a container which can be used to store liquids. More... | |
| bool | is_container_empty () const |
| Whether this item has no contents at all. More... | |
| bool | is_non_resealable_container () const |
| Whether removing this item's contents will permanently alter it. More... | |
| bool | is_container_full (bool allow_bucket=false) const |
| Whether this item has no more free capacity for its current content. More... | |
| void | fill_with (item &liquid, int amount=INFINITE_CHARGES) |
| Fill item with liquid up to its capacity. More... | |
| int | get_remaining_capacity_for_liquid (const item &liquid, bool allow_bucket=false, std::string *err=nullptr) const |
| How much more of this liquid (in charges) can be put in this container. More... | |
| int | get_remaining_capacity_for_liquid (const item &liquid, const Character &p, std::string *err=nullptr) const |
| units::volume | get_container_capacity () const |
| It returns the total capacity (volume) of the container for liquids. More... | |
| units::volume | get_total_capacity () const |
| It returns the maximum volume of any contents, including liquids, ammo, magazines, weapons, etc. More... | |
| void | put_in (const item &payload) |
| Puts the given item into this one, no checks are performed. More... | |
| item | in_its_container () const |
| Returns this item into its default container. More... | |
| item | in_container (const itype_id &container_type) const |
| bool | item_has_uses_recursive () const |
| bool | is_funnel_container (units::volume &bigger_than) const |
| Funnel related functions. More... | |
| void | add_rain_to_container (bool acid, int charges=1) |
| Add charge(s) of rain to given container, possibly contaminating it. More... | |
| int | get_quality (const quality_id &id) const |
| std::map< quality_id, int > | get_qualities () const |
| bool | count_by_charges () const |
| int | count () const |
| If count_by_charges(), returns charges, otherwise 1. More... | |
| bool | craft_has_charges () |
| void | mod_charges (int mod) |
| Modify the charges of this item, only use for items counted by charges! The item must have enough charges for this (>= quantity) and be counted by charges. More... | |
| bool | actualize_rot (const tripoint &pnt, temperature_flag temperature, const weather_manager &weather) |
| Whether the item has to be removed as it has rotten away completely. More... | |
| time_duration | calc_rot (time_point time, int temp) const |
| Returns rot of the item since last rot calculation. More... | |
| time_duration | minimum_freshness_duration (temperature_flag temperature) const |
| Time that this item is guaranteed to stay fresh. More... | |
| void | mod_last_rot_check (time_duration processing_duration) |
| This is part of a workaround so that items don't rot away to nothing if the smoking rack is outside the reality bubble. More... | |
| bool | process_rot (const tripoint &pos) |
| Update temperature for things like food Update rot for things that perish All items that rot also have temperature. More... | |
| bool | process_rot (bool seals, const tripoint &pos, player *carrier, temperature_flag flag, const weather_manager &weather_generator) |
| int | get_comestible_fun () const |
| bool | goes_bad () const |
| whether an item is perishable (can rot) More... | |
| bool | goes_bad_after_opening () const |
| whether an item is perishable (can rot), even if it is currently in a preserving container More... | |
| time_duration | get_shelf_life () const |
| Get the shelf life of the item. More... | |
| double | get_relative_rot () const |
| Get rot value relative to shelf life (or 0 if item does not spoil) More... | |
| void | set_relative_rot (double val) |
| Set current item rot relative to shelf life (no-op if item does not spoil) More... | |
| void | set_rot (time_duration val) |
| int | spoilage_sort_order () const |
| Get time left to rot, ignoring fridge. More... | |
| bool | is_fresh () const |
| an item is fresh if it is capable of rotting but still has a long shelf life remaining More... | |
| bool | is_going_bad () const |
| an item is about to become rotten when shelf life has nearly elapsed More... | |
| bool | rotten () const |
| returns true if item is now rotten after all shelf life has elapsed More... | |
| bool | has_rotten_away () const |
| Whether the item has enough rot that it should get removed. More... | |
| time_duration | get_rot () const |
| void | mod_rot (const time_duration &val) |
| time_duration | brewing_time () const |
| Time for this item to be fully fermented. More... | |
| const std::vector< itype_id > & | brewing_results () const |
| The results of fermenting this item. More... | |
| bool | detonate (const tripoint &p, std::vector< item > &drops) |
| Detonates the item and adds remains (if any) to drops. More... | |
| bool | will_explode_in_fire () const |
Material(s) of the item | |
Each item is made of one or more materials (material_type). Materials have properties that affect properties of the item (e.g. resistance against certain damage types). Corpses inherit the material of the monster type. | |
| const material_type & | get_random_material () const |
| Get a material reference to a random material that this item is made of. More... | |
| const material_type & | get_base_material () const |
| Get the basic (main) material of this item. More... | |
| const std::vector< material_id > & | made_of () const |
| The ids of all the materials this is made of. More... | |
| const std::map< quality_id, int > & | quality_of () const |
| The ids of all the qualities this contains. More... | |
| std::vector< const material_type * > | made_of_types () const |
| Same as made_of(), but returns the material_type directly. More... | |
| bool | made_of_any (const std::set< material_id > &mat_idents) const |
| Check we are made of at least one of a set (e.g. More... | |
| bool | only_made_of (const std::set< material_id > &mat_idents) const |
| Check we are made of only the materials (e.g. More... | |
| bool | made_of (const material_id &mat_ident) const |
| Check we are made of this material (e.g. More... | |
| bool | contents_made_of (phase_id phase) const |
| If contents nonempty, return true if item phase is same, else false. More... | |
| bool | made_of (phase_id phase) const |
| Are we solid, liquid, gas, plasma? More... | |
| std::vector< item_comp > | get_uncraft_components () const |
| Returns a list of components used to craft this item or the default components if it wasn't player-crafted. More... | |
| bool | conductive () const |
| Whether the items is conductive. More... | |
| bool | flammable (int threshold=0) const |
| Whether the items is flammable. More... | |
| bool | reinforceable () const |
| Whether the item can be repaired beyond normal health. More... | |
| int | acid_resist (bool to_self=false, int base_env_resist=0) const |
| Resistance against different damage types (damage_type). More... | |
| int | fire_resist (bool to_self=false, int base_env_resist=0) const |
| int | bash_resist (bool to_self=false) const |
| int | cut_resist (bool to_self=false) const |
| int | stab_resist (bool to_self=false) const |
| int | bullet_resist (bool to_self=false) const |
| void | mitigate_damage (damage_unit &du) const |
| Assuming that specified du hit the armor, reduce du based on the item's resistance to the damage type. More... | |
| int | damage_resist (damage_type dt, bool to_self=false) const |
| Resistance provided by this item against damage type given by an enum. More... | |
| int | chip_resistance (bool worst=false) const |
| Returns resistance to being damaged by attack against the item itself. More... | |
| int | damage () const |
| How much damage has the item sustained? More... | |
| int | damage_level (int max) const |
| Scale item damage to the given number of levels. More... | |
| int | min_damage () const |
| Minimum amount of damage to an item (state of maximum repair) More... | |
| int | max_damage () const |
| Maximum amount of damage to an item (state before destroyed) More... | |
| float | get_relative_health () const |
| Relative item health. More... | |
| bool | mod_damage (int qty, damage_type dt) |
| Apply damage to const itemrained by min_damage and max_damage. More... | |
| bool | mod_damage (int qty) |
| same as other mod_damage, but uses DT_NULL as damage type. More... | |
| bool | inc_damage (damage_type dt) |
| Increment item damage by itype::damage_scale constrained by max_damage. More... | |
| bool | inc_damage () |
| same as other inc_damage, but uses DT_NULL as damage type. More... | |
| nc_color | damage_color () const |
| Provide color for UI display dependent upon current item damage level. More... | |
| std::string | damage_symbol () const |
| Provide prefix symbol for UI display dependent upon current item damage level. More... | |
| std::string | durability_indicator (bool include_intact=false) const |
| Provides a prefix for the durability state of the item. More... | |
| const std::set< itype_id > & | repaired_with () const |
| If possible to repair this item what tools could potentially be used for this purpose? More... | |
| bool | already_used_by_player (const player &p) const |
| Check whether the item has been marked (by calling mark_as_used_by_player) as used by this specific player. More... | |
| void | mark_as_used_by_player (const player &p) |
| Marks the item as being used by this specific player, it remains unmarked for other players. More... | |
| bool | is_filthy () const |
| Marks the item as filthy, so characters with squeamish trait can't wear it. More... | |
| bool | process (player *carrier, const tripoint &pos, bool activate, temperature_flag flag=temperature_flag::TEMP_NORMAL) |
| This is called once each turn. More... | |
| bool | process (player *carrier, const tripoint &pos, bool activate, temperature_flag flag, const weather_manager &weather_generator) |
| std::optional< tripoint > | get_cable_target (Character *p, const tripoint &pos) const |
| Gets the point (vehicle tile) the cable is connected to. More... | |
| void | reset_cable (player *p) |
| Helper to bring a cable back to its initial state. More... | |
| bool | needs_processing () const |
| Whether the item should be processed (by calling process). More... | |
| int | processing_speed () const |
| The rate at which an item should be processed, in number of turns between updates. More... | |
| void | process_artifact (player *carrier, const tripoint &pos) |
| Process and apply artifact effects. More... | |
| void | process_relic (Character &carrier) |
| bool | destroyed_at_zero_charges () const |
| bool | is_null () const |
| bool | is_comestible () const |
| bool | is_food () const |
| bool | is_food_container () const |
| bool | is_med_container () const |
| bool | is_ammo_container () const |
| bool | is_medication () const |
| bool | is_bionic () const |
| bool | is_magazine () const |
| bool | is_battery () const |
| bool | is_ammo_belt () const |
| bool | is_bandolier () const |
| bool | is_holster () const |
| bool | is_ammo () const |
| bool | is_pet_armor (bool on_pet=false) const |
| bool | is_armor () const |
| bool | is_book () const |
| bool | is_map () const |
| bool | is_salvageable () const |
| bool | is_craft () const |
| bool | is_deployable () const |
| bool | is_tool () const |
| bool | is_transformable () const |
| bool | is_artifact () const |
| bool | is_relic () const |
| bool | is_bucket () const |
| bool | is_bucket_nonempty () const |
| bool | is_brewable () const |
| bool | is_engine () const |
| bool | is_wheel () const |
| bool | is_fuel () const |
| bool | is_toolmod () const |
| bool | is_faulty () const |
| bool | is_irremovable () const |
| bool | is_unarmed_weapon () const |
| item * | get_food () |
| const item * | get_food () const |
| int | wind_resist () const |
| How resistant clothes made of this material are to wind (0-100) More... | |
| std::set< fault_id > | faults_potential () const |
| What faults can potentially occur with this item? More... | |
| int | wheel_area () const |
| Returns the total area of this wheel or 0 if it isn't one. More... | |
| float | fuel_energy () const |
| Returns energy of one charge of this item as fuel for an engine. More... | |
| std::string | fuel_pump_terrain () const |
| Returns the string of the id of the terrain that pumps this fuel, if any. More... | |
| bool | has_explosion_data () const |
| struct fuel_explosion | get_explosion_data () |
| bool | can_contain (const item &it) const |
| Can this item have given item/itype as content? More... | |
| bool | can_contain (const itype &tp) const |
| bool | is_reloadable () const |
| Is it ever possible to reload this item? Only the base item is considered with any mods ignored. More... | |
| bool | can_reload_with (const ammotype &ammo) const |
| Returns true if this item can be reloaded with specified ammo type, ignoring currently loaded ammo. More... | |
| bool | can_reload_with (const itype_id &ammo) const |
| Returns true if this item can be reloaded with specified ammo item, ignoring currently loaded ammo. More... | |
| bool | is_reloadable_with (const itype_id &ammo) const |
| Returns true if this item can be reloaded with specified ammo type at this moment. More... | |
| bool | can_unload_liquid () const |
| Returns true if not empty if it's liquid, it's not currently frozen in resealable container. More... | |
| bool | is_dangerous () const |
| bool | is_tainted () const |
| Is item derived from a zombie? More... | |
| bool | is_soft () const |
| Is this item flexible enough to be worn on body parts like antlers? More... | |
| bool | has_effect_when_wielded (art_effect_passive effect) const |
| Does the item provide the artifact effect when it is wielded? More... | |
| bool | has_effect_when_worn (art_effect_passive effect) const |
| Does the item provide the artifact effect when it is worn? More... | |
| bool | has_effect_when_carried (art_effect_passive effect) const |
| Does the item provide the artifact effect when it is carried? More... | |
| void | set_snippet (const snippet_id &id) |
| Set the snippet text (description) of this specific item, using the snippet library. More... | |
| bool | operator< (const item &other) const |
| std::string | components_to_string () const |
| List of all components in printable form, empty if this item has no components. More... | |
| uint64_t | make_component_hash () const |
| Creates a hash from the itype_ids of this item's components. More... | |
| const itype_id & | typeId () const |
| return the unique identifier of the items underlying type More... | |
| const item & | get_contained () const |
| Return a contained item (if any and only one). More... | |
| bool | spill_contents (Character &c) |
| Unloads the item's contents. More... | |
| bool | spill_contents (const tripoint &pos) |
| Unloads the item's contents. More... | |
| bool | can_holster (const item &obj, bool ignore=false) const |
| Checks if item is a holster and currently capable of storing obj. More... | |
| void | on_wear (Character &p) |
| Callback when a character starts wearing the item. More... | |
| void | on_takeoff (Character &p) |
| Callback when a character takes off an item. More... | |
| void | on_wield (player &p, int mv=0) |
| Callback when a player starts wielding the item. More... | |
| void | on_pickup (Character &p) |
| Callback when a player starts carrying the item. More... | |
| void | on_contents_changed () |
| Callback when contents of the item are affected in any way other than just processing. More... | |
| void | on_damage (int qty, damage_type dt) |
| Callback immediately before an item is damaged. More... | |
| std::vector< trait_id > | mutations_from_wearing (const Character &guy) const |
| std::string | type_name (unsigned int quantity=1) const |
| Name of the item type (not the item), with proper plural. More... | |
| int | charges_per_volume (const units::volume &vol) const |
| Number of (charges of) this item that fit into the given volume. More... | |
Item variables | |
Item variables can be used to store any value in the item. The storage is persistent, it remains through saving & loading, it is copied when the item is moved etc. Each item variable is referred to by its name, so make sure you use a name that is not already used somewhere. You can directly store integer, floating point and string values. Data of other types must be converted to one of those to be stored. The set_var functions override the existing value. The get_var function return the value (if the variable exists), or the default value otherwise. The type of the default value determines which get_var function is used. All numeric values are returned as doubles and may be cast to the desired type. | |
| void | set_var (const std::string &name, int value) |
| void | set_var (const std::string &name, long long value) |
| void | set_var (const std::string &name, long value) |
| void | set_var (const std::string &name, double value) |
| double | get_var (const std::string &name, double default_value) const |
| void | set_var (const std::string &name, const tripoint &value) |
| tripoint | get_var (const std::string &name, const tripoint &default_value) const |
| void | set_var (const std::string &name, const std::string &value) |
| std::string | get_var (const std::string &name, const std::string &default_value) const |
| std::string | get_var (const std::string &name) const |
| Get the variable, if it does not exists, returns an empty string. More... | |
| bool | has_var (const std::string &name) const |
| Whether the variable is defined at all. More... | |
| void | erase_var (const std::string &name) |
| Erase the value of the given variable. More... | |
| void | clear_vars () |
| Removes all item variables. More... | |
Item flags | |
If you use any new flags, add them to Item flags are taken from the item type (itype::item_tags), but also from the item itself (item_tags). The item has the flag if it appears in either set. Gun mods that are attached to guns also contribute their flags to the gun item. | |
| bool | has_flag (const std::string &flag) const |
| bool | has_flag (const flag_str_id &flag) const |
| template<typename Container , typename T = std::decay_t<decltype( *std::declval<const Container &>().begin() )>> | |
| bool | has_any_flag (const Container &flags) const |
| bool | has_own_flag (const std::string &flag) const |
| Checks whether item itself has given flag (doesn't check item type or gunmods). More... | |
| const FlagsSetType & | get_flags () const |
| returs read-only set of flags of this item (not including flags from item type or gunmods) More... | |
| item & | set_flag (const std::string &flag) |
| Idempotent filter setting an item specific flag. More... | |
| item & | unset_flag (const std::string &flag) |
| Idempotent filter removing an item specific flag. More... | |
| item & | set_flag_recursive (const std::string &flag) |
| Idempotent filter recursively setting an item specific flag on this item and its components. More... | |
| void | unset_flags () |
| Removes all item specific flags. More... | |
| bool | has_fault (const fault_id &fault) const |
| Does this item have the specified fault. More... | |
Item properties | |
Properties are specific to an item type so unlike flags the meaning of a property may not be the same for two different item types. Each item type can have multiple properties however duplicate property names are not permitted. | |
| bool | has_property (const std::string &prop) const |
| std::string | get_property_string (const std::string &prop, const std::string &def="") const |
| Get typed property for item. More... | |
| int64_t | get_property_int64_t (const std::string &prop, int64_t def=0) const |
Light emitting items | |
Items can emit light either through the definition of their type (itype::light_emission) or through an item specific light data (light). | |
| bool | getlight (float &luminance, units::angle &width, units::angle &direction) const |
| Directional light emission of the item. More... | |
| int | getlight_emit () const |
| How much light (see lightmap.cpp) the item emits (it's assumed to be circular). More... | |
| bool | is_emissive () const |
| Whether the item emits any light at all. More... | |
Seed data. | |
| bool | is_seed () const |
| Whether this is actually a seed, the seed functions won't be of much use for non-seeds. More... | |
| time_duration | get_plant_epoch () const |
| Time it takes to grow from one stage to another. More... | |
| std::string | get_plant_name () const |
| The name of the plant as it appears in the various informational menus. More... | |
Armor related functions. | |
The functions here refer to values from islot_armor. They only apply to armor items, those items can be worn. The functions are safe to call for any item, for non-armor they return a default value. | |
| bool | covers (body_part bp) const |
| Whether this item (when worn) covers the given body part. More... | |
| bool | covers (const bodypart_id &bp) const |
| body_part_set | get_covered_body_parts () const |
| Bitset of all covered body parts. More... | |
| body_part_set | get_covered_body_parts (side s) const |
| Bitset of all covered body parts, from a specific side. More... | |
| bool | is_sided () const |
| Returns true if item is armor and can be worn on different sides of the body. More... | |
| side | get_side () const |
| Returns side item currently worn on. More... | |
| bool | set_side (side s) |
| Change the side on which the item is worn. More... | |
| bool | swap_side () |
| Swap the side on which the item is worn. More... | |
| int | get_warmth () const |
| Returns the warmth value that this item has when worn. More... | |
| int | get_thickness () const |
| Returns the islot_armor::thickness value, or 0 for non-armor. More... | |
| layer_level | get_layer () const |
| Returns clothing layer for item. More... | |
| int | get_coverage () const |
| Returns the relative coverage that this item has when worn. More... | |
| int | get_encumber_when_containing (const Character &, const units::volume &contents_volume) const |
| Returns the encumbrance value that this item has when worn by given player, when containing a particular volume of contents. More... | |
| int | get_encumber (const Character &) const |
| Returns the encumbrance value that this item has when worn by given player. More... | |
| units::volume | get_storage () const |
| Returns the storage amount (islot_armor::storage) that this item provides when worn. More... | |
| float | get_weight_capacity_modifier () const |
| Returns the weight capacity modifier (islot_armor::weight_capacity_modifier) that this item provides when worn. More... | |
| units::mass | get_weight_capacity_bonus () const |
| Returns the weight capacity bonus (islot_armor::weight_capacity_modifier) that this item provides when worn. More... | |
| int | get_env_resist (int override_base_resist=0) const |
| Returns the resistance to environmental effects (islot_armor::env_resist) that this item provides when worn. More... | |
| int | get_base_env_resist_w_filter () const |
| Returns the base resistance to environmental effects if an item (for example a gas mask) requires a gas filter to operate and this filter is installed. More... | |
| bool | is_power_armor () const |
| Whether this is a power armor item. More... | |
| const islot_armor * | find_armor_data () const |
| If this is an armor item, return its armor data. More... | |
| bool | is_worn_only_with (const item &it) const |
| Returns true whether this item can be worn only when. More... | |
Pet armor related functions. | |
The functions here refer to values from islot_pet_armor. They only apply to pet armor items, those items can be worn by pets. The functions are safe to call for any item, for non-pet armor they return a default value. | |
| units::volume | get_pet_armor_max_vol () const |
| units::volume | get_pet_armor_min_vol () const |
| bodytype_id | get_pet_armor_bodytype () const |
Books | |
Book specific functions, apply to items that are books. | |
| int | get_chapters () const |
| How many chapters the book has (if any). More... | |
| int | get_remaining_chapters (const Character &ch) const |
| Get the number of unread chapters. More... | |
| void | mark_chapter_as_read (const Character &ch) |
| Mark one chapter of the book as read by the given player. More... | |
| std::vector< std::pair< const recipe *, int > > | get_available_recipes (const player &u) const |
| Enumerates recipes available from this book and the skill level required to use them. More... | |
Martial art techniques | |
See martialarts.h for further info. | |
| bool | has_technique (const matec_id &tech) const |
| Whether the item supports a specific martial art technique (either through its type, or through its individual techniques). More... | |
| std::set< matec_id > | get_techniques () const |
| Returns all the martial art techniques that this items supports. More... | |
| void | add_technique (const matec_id &tech) |
| Add the given technique to the item specific techniques. More... | |
| std::vector< item * > | toolmods () |
| Returns all toolmods currently attached to this item (always empty if item not a tool) More... | |
| std::vector< const item * > | toolmods () const |
Gun and gunmod functions | |
Gun and gun mod functions. Anything stated to apply to guns, applies to auxiliary gunmods as well (they are some kind of gun). Non-guns are items that are neither gun nor auxiliary gunmod. | |
| bool | is_gunmod () const |
| bool | is_gun () const |
| Can this item be used to perform a ranged attack? More... | |
| units::energy | energy_remaining () const |
| Quantity of energy currently loaded in tool or battery. More... | |
| int | ammo_remaining () const |
| Quantity of ammunition currently loaded in tool, gun or auxiliary gunmod. More... | |
| int | ammo_capacity () const |
| Maximum quantity of ammunition loadable for tool, gun or auxiliary gunmod. More... | |
| int | ammo_capacity (bool potential_capacity) const |
| int | ammo_required () const |
| Quantity of ammunition consumed per usage of tool or with each shot of gun. More... | |
| bool | ammo_sufficient (int qty=1) const |
| Check if sufficient ammo is loaded for given number of uses. More... | |
| int | ammo_consume (int qty, const tripoint &pos) |
| Consume ammo (if available) and return the amount of ammo that was consumed. More... | |
| const itype * | ammo_data () const |
| Specific ammo data, returns nullptr if item is neither ammo nor loaded with any. More... | |
| itype_id | ammo_current () const |
| Specific ammo type, returns "null" if item is neither ammo nor loaded with any. More... | |
| const std::set< ammotype > & | ammo_types (bool conversion=true) const |
| Set of ammo types (ammunition_type) used by item. More... | |
| ammotype | ammo_type () const |
| Ammo type of an ammo item. More... | |
| itype_id | ammo_default (bool conversion=true) const |
| Get default ammo used by item or a null id if item does not have a default ammo type. More... | |
| itype_id | common_ammo_default (bool conversion=true) const |
| Get default ammo for the first ammotype common to an item and its current magazine or "NULL" if none exists. More... | |
| std::set< ammo_effect_str_id > | ammo_effects (bool with_ammo=true) const |
| Get ammo effects for item optionally inclusive of any resulting from the loaded ammo. More... | |
| std::string | ammo_sort_name () const |
| int | casings_count () const |
| How many spent casings are contained within this item? More... | |
| void | casings_handle (const std::function< bool(item &)> &func) |
| Apply predicate to each contained spent casing removing it if predicate returns true. More... | |
| bool | magazine_integral () const |
| Does item have an integral magazine (as opposed to allowing detachable magazines) More... | |
| itype_id | magazine_default (bool conversion=true) const |
| Get the default magazine type (if any) for the current effective ammo type. More... | |
| std::set< itype_id > | magazine_compatible (bool conversion=true) const |
| Get compatible magazines (if any) for this item. More... | |
| item * | magazine_current () |
| Currently loaded magazine (if any) More... | |
| const item * | magazine_current () const |
| std::vector< item * > | gunmods () |
| Returns all gunmods currently attached to this item (always empty if item not a gun) More... | |
| std::vector< const item * > | gunmods () const |
| item * | gunmod_find (const itype_id &mod) |
| Get first attached gunmod matching type or nullptr if no such mod or item is not a gun. More... | |
| const item * | gunmod_find (const itype_id &mod) const |
| ret_val< bool > | is_gunmod_compatible (const item &mod) const |
| std::map< gun_mode_id, gun_mode > | gun_all_modes () const |
| Get all possible modes for this gun inclusive of any attached gunmods. More... | |
| gun_mode | gun_get_mode (const gun_mode_id &mode) const |
| Check if gun supports a specific mode returning an invalid/empty mode if not. More... | |
| gun_mode | gun_current_mode () const |
| Get the current mode for this gun (or an invalid mode if item is not a gun) More... | |
| gun_mode_id | gun_get_mode_id () const |
| Get id of mode a gun is currently set to, e.g. More... | |
| bool | gun_set_mode (const gun_mode_id &mode) |
| Try to set the mode for a gun, returning false if no such mode is possible. More... | |
| void | gun_cycle_mode () |
| Switch to the next available firing mode. More... | |
| int | sight_dispersion () const |
| Get lowest dispersion of either integral or any attached sights. More... | |
| sound_data | gun_noise (bool burst=false) const |
| Returns the sound of the gun being fired. More... | |
| bool | is_silent () const |
| Whether this is a (nearly) silent gun (a tiny bit of sound is allowed). More... | |
| int | gun_range (const player *p) const |
| The weapons range in map squares. More... | |
| int | gun_range (bool with_ammo=true) const |
| Summed range value of a gun, including values from mods. More... | |
| double | gun_recoil_multiplier (bool bipod=false) const |
| Get multiplier on recoil considering handling and attached gunmods. More... | |
| int | gun_recoil (bool bipod=false) const |
| Get effective recoil considering handling, loaded ammo and effects of attached gunmods. More... | |
| damage_instance | gun_damage (bool with_ammo=true) const |
| Summed ranged damage, armor piercing, and multipliers for both, of a gun, including values from mods. More... | |
| int | gun_dispersion (bool with_ammo=true, bool with_scaling=true) const |
| Summed dispersion of a gun, including values from mods. More... | |
| skill_id | gun_skill () const |
| The skill used to operate the gun. More... | |
| gun_type_type | gun_type () const |
| Get the type of a ranged weapon (e.g. More... | |
| std::map< gunmod_location, int > | get_mod_locations () const |
| Get mod locations, including those added by other mods. More... | |
| int | get_free_mod_locations (const gunmod_location &location) const |
| Number of mods that can still be installed into the given mod location, for non-guns it always returns 0. More... | |
| bool | is_firearm () const |
| Does it require gunsmithing tools to repair. More... | |
| int | get_reload_time () const |
| Returns the reload time of the gun. More... | |
Vehicle parts | |
| int | engine_displacement () const |
| for combustion engines the displacement (cc) More... | |
Public Member Functions inherited from visitable< item > | |
| VisitResponse | visit_items (const std::function< VisitResponse(item *, item *)> &func) |
| Traverses this object and any child items contained using a visitor pattern. More... | |
| VisitResponse | visit_items (const std::function< VisitResponse(const item *, const item *)> &func) const |
| VisitResponse | visit_items (const std::function< VisitResponse(item *)> &func) |
| Lightweight version which provides only the current node. More... | |
| VisitResponse | visit_items (const std::function< VisitResponse(const item *)> &func) const |
| item * | find_parent (const item &it) |
| Determine the immediate parent container (if any) for an item. More... | |
| const item * | find_parent (const item &it) const |
| std::vector< item * > | parents (const item &it) |
| Returns vector of parent containers (if any) starting with the innermost. More... | |
| std::vector< const item * > | parents (const item &it) const |
| bool | has_item (const item &it) const |
| Returns true if this visitable instance contains the item. More... | |
| bool | has_item_with (const std::function< bool(const item &)> &filter) const |
| Returns true if any item (including those within a container) matches the filter. More... | |
| bool | has_quality (const quality_id &qual, int level=1, int qty=1) const |
| Returns true if instance has amount (or more) items of at least quality level. More... | |
| int | max_quality (const quality_id &qual) const |
| Return maximum tool quality level provided by instance or INT_MIN if not found. More... | |
| int | charges_of (const itype_id &what, int limit=INT_MAX, const std::function< bool(const item &)> &filter=return_true< item >, std::function< void(int)> visitor=nullptr) const |
| Count maximum available charges from this instance and any contained items. More... | |
| int | amount_of (const itype_id &what, bool pseudo=true, int limit=INT_MAX, const std::function< bool(const item &)> &filter=return_true< item >) const |
| Count items matching id including both this instance and any contained items. More... | |
| bool | has_amount (const itype_id &what, int qty, bool pseudo=true, const std::function< bool(const item &)> &filter=return_true< item >) const |
| Check instance provides at least qty of an item (. More... | |
| std::vector< item * > | items_with (const std::function< bool(const item &)> &filter) |
| Returns all items (including those within a container) matching the filter. More... | |
| std::vector< const item * > | items_with (const std::function< bool(const item &)> &filter) const |
| std::list< item > | remove_items_with (const std::function< bool(const item &)> &filter, int count=INT_MAX) |
| Removes items contained by this instance which match the filter. More... | |
| item | remove_item (item &it) |
| Removes and returns the item which must be contained by this instance. More... | |
Static Public Member Functions | |
| static item | make_corpse (const mtype_id &mt=string_id< mtype >::NULL_ID(), time_point turn=calendar::turn, const std::string &name="", int upgrade_time=-1) |
| Make a corpse of the given monster type. More... | |
Bionics / CBMs | |
| enum class | sizing { human_sized_human_char = 0 , big_sized_human_char , small_sized_human_char , big_sized_big_char , human_sized_big_char , small_sized_big_char , small_sized_small_char , human_sized_small_char , big_sized_small_char , not_wearable } |
| static const int | INFINITE_CHARGES = INT_MAX |
| const itype * | type |
| item_contents | contents |
| std::list< item > | components |
| std::set< fault_id > | faults |
| What faults (if any) currently apply to this item. More... | |
| FlagsSetType | item_tags |
| int | charges |
| units::energy | energy |
| int | recipe_charges = 1 |
| int | burnt = 0 |
| int | poison = 0 |
| int | frequency = 0 |
| snippet_id | snip_id = snippet_id::NULL_ID() |
| int | irradiation = 0 |
| int | item_counter = 0 |
| int | mission_id = -1 |
| int | player_id = -1 |
| bool | encumbrance_update_ = false |
| char | invlet = 0 |
| bool | active = false |
| safe_reference< Character > | activated_by |
| bool | is_favorite = false |
| pimpl< item_drop_token > | drop_token |
| Two items are dropped in same "batch" if they have identical drop tokens Ideally, this would be stored outside item class. More... | |
| safe_reference_anchor | anchor |
| const itype * | curammo = nullptr |
| std::map< std::string, std::string > | item_vars |
| const mtype * | corpse = nullptr |
| std::string | corpse_name |
| std::set< matec_id > | techniques |
| cata::value_ptr< craft_data > | craft_data_ |
| cata::value_ptr< relic > | relic_data |
| time_duration | rot = 0_turns |
| Accumulated rot, expressed as time the item has been in standard temperature. More... | |
| time_point | last_rot_check = calendar::turn_zero |
| Time when the rot calculation was last performed. More... | |
| time_point | bday |
| The time the item was created. More... | |
| faction_id | owner = faction_id::NULL_ID() |
| faction_id | old_owner = faction_id::NULL_ID() |
| int | damage_ = 0 |
| light_emission | light = nolight |
| bool | is_upgrade () const |
| Whether the CBM is an upgrade to another bionic module. More... | |
| bool | has_use () const |
| Returns true if the item has any use function. More... | |
| const use_function * | get_use (const std::string &use_name) const |
| Returns the pointer to use_function with name use_name assigned to the type of this item or any of its contents. More... | |
| item * | get_usable_item (const std::string &use_name) |
| Checks this item and its contents (recursively) for types that have use_function with type use_name. More... | |
| int | units_remaining (const Character &ch, int limit=INT_MAX) const |
| How many units (ammo or charges) are remaining? More... | |
| bool | units_sufficient (const Character &ch, int qty=-1) const |
| Check if item has sufficient units (ammo or charges) remaining. More... | |
| std::string | get_corpse_name () |
| Returns name of deceased being if it had any or empty string if not. More... | |
| bool | has_label () const |
| Returns true if item has "item_label" itemvar. More... | |
| std::string | label (unsigned int quantity=0) const |
| Returns label from "item_label" itemvar and quantity. More... | |
| bool | has_infinite_charges () const |
| skill_id | contextualize_skill (const skill_id &id) const |
| Puts the skill in context of the item. More... | |
| bool | release_monster (const tripoint &target, int radius=0) |
| int | contain_monster (const tripoint &target) |
| time_duration | age () const |
| void | set_age (const time_duration &age) |
| void | legacy_fast_forward_time () |
| time_point | birthday () const |
| void | set_birthday (const time_point &bday) |
| void | handle_pickup_ownership (Character &c) |
| int | get_gun_ups_drain () const |
| void | validate_ownership () const |
| void | set_old_owner (const faction_id &temp_owner) |
| void | remove_old_owner () const |
| void | set_owner (const faction_id &new_owner) |
| void | set_owner (const Character &c) |
| void | remove_owner () const |
| faction_id | get_owner () const |
| faction_id | get_old_owner () const |
| bool | is_owned_by (const Character &c, bool available_to_take=false) const |
| bool | is_old_owner (const Character &c, bool available_to_take=false) const |
| std::string | get_owner_name () const |
| int | get_min_str () const |
| const cata::value_ptr< islot_comestible > & | get_comestible () const |
| const recipe & | get_making () const |
| Get the stored recipe for in progress crafts. More... | |
| int | get_next_failure_point () const |
| Get the failure point stored in this item. More... | |
| void | set_next_failure_point (const player &crafter) |
| Calculates and sets the next failure point for an in progress craft. More... | |
| bool | handle_craft_failure (player &crafter) |
| Handle failure during crafting. More... | |
| requirement_data | get_continue_reqs () const |
| Returns requirement data representing what is needed to resume work on an in progress craft. More... | |
| void | inherit_flags (const item &parent, const recipe &making) |
| Inherit applicable flags from the given parent item. More... | |
| void | inherit_flags (const std::list< item > &parents, const recipe &making) |
| Inherit applicable flags from the given list of parent items. More... | |
| void | set_tools_to_continue (bool value) |
| bool | has_tools_to_continue () const |
| void | set_cached_tool_selections (const std::vector< comp_selection< tool_comp > > &selections) |
| const std::vector< comp_selection< tool_comp > > & | get_cached_tool_selections () const |
| const std::vector< enchantment > & | get_enchantments () const |
| double | bonus_from_enchantments (const Character &owner, double base, enchant_vals::mod value, bool round=false) const |
| Calculate bonus from enchantments that affect this item only. More... | |
| double | bonus_from_enchantments_wielded (double base, enchant_vals::mod value, bool round=false) const |
| Calculate bonus from enchantments that affect this item only, assume it's wielded and all enchantments' conditions are satisfied. More... | |
| const std::vector< relic_recharge > & | get_relic_recharge_scheme () const |
| sizing | get_sizing (const Character &, bool) const |
| void | set_favorite (bool favorite) |
| bool | has_clothing_mod () const |
| float | get_clothing_mod_val (clothing_mod_type type) const |
| void | update_clothing_mod_val () |
| static std::string | nname (const itype_id &id, unsigned int quantity=1) |
| Returns the translated item name for the item with given id. More... | |
| static bool | count_by_charges (const itype_id &id) |
| Whether the item is counted by charges, this is a static wrapper around count_by_charges, that does not need an items instance. More... | |
| bool | use_amount_internal (const itype_id &it, int &quantity, std::list< item > &used, const std::function< bool(const item &)> &filter=return_true< item >) |
| const use_function * | get_use_internal (const std::string &use_name) const |
| bool | process_internal (player *carrier, const tripoint &pos, bool activate, bool seals, temperature_flag flag, const weather_manager &weather_generator) |
| bool | is_reloadable_helper (const itype_id &ammo, bool now) const |
| Helper for checking reloadability. More... | |
| bool | process_corpse (player *carrier, const tripoint &pos) |
| bool | process_wet (player *carrier, const tripoint &pos) |
| bool | process_litcig (player *carrier, const tripoint &pos) |
| bool | process_extinguish (player *carrier, const tripoint &pos) |
| bool | process_fake_smoke (player *carrier, const tripoint &pos) |
| bool | process_fake_mill (player *carrier, const tripoint &pos) |
| bool | process_cable (player *carrier, const tripoint &pos) |
| bool | process_UPS (player *carrier, const tripoint &pos) |
| bool | process_blackpowder_fouling (player *carrier) |
| bool | process_tool (player *carrier, const tripoint &pos) |
Additional Inherited Members | |
Related Functions inherited from visitable< item > | |
| VisitResponse | visit_items (const std::function< VisitResponse(const item *, const item *)> &func) const |
| VisitResponse | visit_items (const std::function< VisitResponse(const item *)> &func) const |
| VisitResponse | visit_items (const std::function< VisitResponse(item *)> &func) |
| VisitResponse | visit_items (const std::function< VisitResponse(item *, item *)> &func) |
| item * | find_parent (const item &it) |
| const item * | find_parent (const item &it) const |
| std::vector< item * > | parents (const item &it) |
| std::vector< const item * > | parents (const item &it) const |
| std::vector< item * > | items_with (const std::function< bool(const item &)> &filter) |
| std::vector< const item * > | items_with (const std::function< bool(const item &)> &filter) const |
| std::list< item > | remove_items_with (const std::function< bool(const item &e)> &filter, int count) |
| using item::FlagsSetType = cata::flat_set<std::string> |
|
strong |
| item::item | ( | ) |
Definition at line 365 of file item.cpp.
References charges, nullitem(), and type.
Referenced by add_rain_to_container(), ammo_set(), vehicle_part::deserialize(), io(), item(), and split().
|
default |
|
default |
|
explicit |
|
explicit |
Definition at line 371 of file item.cpp.
References active, ammo_default(), ammo_remaining(), ammo_set(), ammo_types(), bday, charges, itype::charges_default(), corpse, itype::countdown_interval, flag_CORPSE(), flag_NANOFAB_TEMPLATE(), goes_bad(), itype::gun, has_flag(), item(), item_counter, item_group::item_from(), last_rot_check, itype::magazine, magazine_integral(), string_id< mtype >::NULL_ID(), string_id< T >::obj(), put_in(), snippet_library::random_id_from_category(), relic_data, itype::relic_data, rng(), set_flag(), set_var(), snip_id, SNIPPET, itype::snippet_category, string_id< T >::str(), itype::tool, calendar::turn, type, and typeId().
| item::item | ( | const itype_id & | id, |
| time_point | turn, | ||
| default_charges_tag | tag | ||
| ) |
| item::item | ( | const itype * | type, |
| time_point | turn, | ||
| default_charges_tag | |||
| ) |
| item::item | ( | const itype_id & | id, |
| time_point | turn, | ||
| solitary_tag | tag | ||
| ) |
| item::item | ( | const itype * | type, |
| time_point | turn, | ||
| solitary_tag | |||
| ) |
| item::item | ( | const recipe * | rec, |
| int | qty, | ||
| std::list< item > | items, | ||
| std::vector< item_comp > | selections | ||
| ) |
For constructing in-progress crafts.
Definition at line 464 of file item.cpp.
References active, bday, components, craft_data_, recipe::flags_to_delete, json_flag::get(), itype::get_flags(), get_most_rotten_component(), get_relative_rot(), goes_bad(), is_food(), last_rot_check, set_flag(), set_relative_rot(), component::type, and unset_flag().
|
inline |
Definition at line 241 of file item.h.
|
default |
| int item::acid_resist | ( | bool | to_self = false, |
| int | base_env_resist = 0 |
||
| ) | const |
Resistance against different damage types (damage_type).
Larger values means more resistance are thereby better, but there is no absolute value to compare them to. The values can be interpreted as chance (one_in) of damaging the item when exposed to the type of damage.
| to_self | If this is true, it returns item's own resistance, not one it gives to wearer. |
| base_env_resist | Will override the base environmental resistance (to allow hypothetical calculations for gas masks). |
Definition at line 6127 of file item.cpp.
References clothing_mod_type_acid, get_clothing_mod_val(), get_env_resist(), is_null(), and made_of_types().
Referenced by armor_inventory_preset::armor_inventory_preset(), armor_protection_info(), anonymous_namespace{armor_layers.cpp}::clothing_protection(), damage_resist(), and sew_advanced_actor::use().
| item & item::activate | ( | ) |
Filter converting instance to active state.
Definition at line 557 of file item.cpp.
References active, itype::countdown_interval, item_counter, and type.
Referenced by iuse::cable_attach(), make_gun_projectile(), process(), and process_internal().
| bool item::actualize_rot | ( | const tripoint & | pnt, |
| temperature_flag | temperature, | ||
| const weather_manager & | weather | ||
| ) |
Whether the item has to be removed as it has rotten away completely.
May change the item as it calls process_rot()
| pnt | The position of the item on the current map. |
| temperature | Flag for special locations that affect temperature. |
| weather | Weather manager to supply temperature. |
Definition at line 8804 of file item.cpp.
References item_contents::all_items_top(), c, itype::container, contents, goes_bad(), process_rot(), visitable< item >::remove_item(), and type.
| void item::add_technique | ( | const matec_id & | tech | ) |
Add the given technique to the item specific techniques.
Note that other items of the same type are not affected by this.
Definition at line 5444 of file item.cpp.
References techniques.
Referenced by mdeath::jabberwock().
| time_duration item::age | ( | ) | const |
Definition at line 10005 of file item.cpp.
References birthday(), and calendar::turn.
Referenced by iexamine::arcfurnace_full(), iexamine::autoclave_full(), basic_info(), player_morale::morale_point::deserialize(), iuse::firecracker_pack_act(), iuse::fish_trap(), iexamine::fvat_full(), iexamine::kiln_full(), submap::load(), process_fake_mill(), process_fake_smoke(), ready_to_revive(), player_morale::morale_point::serialize(), set_age(), and delayed_transform_iuse::time_to_do().
| bool item::allow_crafting_component | ( | ) | const |
Permits filthy components, should only be used as a helper in creating filters.
Definition at line 8538 of file item.cpp.
References ammo_battery, ammo_types(), contents, count(), item_contents::empty(), is_gun(), is_gunmod(), is_irremovable(), is_magazine(), is_toolmod(), NEXT, and visitable< item >::visit_items().
| bool item::already_used_by_player | ( | const player & | p | ) | const |
Check whether the item has been marked (by calling mark_as_used_by_player) as used by this specific player.
Definition at line 8853 of file item.cpp.
References character_id::get_value(), Character::getID(), item_vars, string_format(), and USED_BY_IDS().
Referenced by tname(), and reveal_map_actor::use().
| int item::ammo_capacity | ( | ) | const |
Maximum quantity of ammunition loadable for tool, gun or auxiliary gunmod.
Definition at line 7414 of file item.cpp.
References ammo_capacity().
Referenced by game::add_artifact_dreams(), ammo_capacity(), vehicle_part::ammo_capacity(), turret_data::ammo_capacity(), ammo_set(), turret_data::can_reload(), crafting::complete_disassemble(), vehicle_part::deserialize(), display_name(), npc::do_reload(), game::dump_stats(), npc::enough_time_to_reload(), find_reloadable_cbms(), character_funcs::fmt_wielded_weapon(), get_remaining_capacity_for_liquid(), getlight_emit(), iuse::hand_crank(), activity_handlers::hand_crank_do_turn(), ideal_ranged_dps(), vehicle::interact_with(), is_reloadable_helper(), magazine_info(), Item_modifier::modify(), target_ui::panel_gun_info(), price(), game::process_artifact(), relic_funcs::process_recharge(), relic_funcs::process_recharge_entry(), process_vehicle_items(), item_reload_option::qty(), avatar_action::reload(), reload(), activity_handlers::repair_item_finish(), tool_info(), avatar_funcs::unload_item(), charger_tile::update_internal(), npc::value(), wants_to_reload(), and npc_ai::wielded_value().
| int item::ammo_capacity | ( | bool | potential_capacity | ) | const |
| potential_capacity | whether to try a default magazine if necessary |
Definition at line 7419 of file item.cpp.
References ammo_capacity(), use_function::get_actor_ptr(), itype::get_use(), itype::gun, gunmods(), is_bandolier(), is_gun(), is_magazine(), is_tool(), itype::magazine, magazine_current(), magazine_default(), itype::tool, toolmods(), and type.
| int item::ammo_consume | ( | int | qty, |
| const tripoint & | pos | ||
| ) |
Consume ammo (if available) and return the amount of ammo that was consumed.
| qty | maximum amount of ammo that should be consumed |
| pos | current location of item, used for ejecting magazines and similar effects |
Definition at line 7485 of file item.cpp.
References map::add_item(), ammo_consume(), ammo_remaining(), charges, contents, curammo, debugmsg, item_contents::empty(), flag_MAG_DESTROY(), flag_MAG_EJECT(), flag_USES_BIONIC_POWER(), units::from_kilojoule(), item_contents::front(), get_avatar(), get_map(), Character::get_power_level(), has_flag(), is_gun(), is_magazine(), is_tool(), magazine_current(), Character::mod_power_level(), visitable< item >::remove_item(), tname(), and units::to_kilojoule().
Referenced by ammo_consume(), vehicle_part::ammo_consume(), Character::consume_charges(), iuse::einktabletpc(), ranged::fire_gun(), activity_handlers::game_do_turn(), iuse::gasmask(), iuse::multicooker(), iuse::note_bionics(), activity_handlers::oxytorch_do_turn(), npc::pretend_fire(), process_tool(), reload(), activity_handlers::repair_item_finish(), toolweapon_on(), and activity_handlers::vibe_do_turn().
| itype_id item::ammo_current | ( | ) | const |
Specific ammo type, returns "null" if item is neither ammo nor loaded with any.
Definition at line 7564 of file item.cpp.
References ammo_data(), itype::get_id(), and string_id< itype >::NULL_ID().
Referenced by vehicle_part::ammo_current(), turret_data::ammo_options(), npc::confident_gun_mode_range(), display_name(), aim_activity_actor::do_turn(), ranged::fire_gun(), avatar_action::fire_wielded_weapon(), get_remaining_capacity_for_liquid(), gun_noise(), npc_ai::gun_value(), ideal_ranged_dps(), is_reloadable_helper(), make_gun_projectile(), parse_tags(), remove_ammo(), activity_handlers::repair_item_finish(), stacks_with(), avatar_funcs::unload_item(), iuse_transform::use(), and weight().
| const itype * item::ammo_data | ( | ) | const |
Specific ammo data, returns nullptr if item is neither ammo nor loaded with any.
Definition at line 7538 of file item.cpp.
References ammo_data(), contents, curammo, item_contents::empty(), item_contents::front(), gunmods(), is_ammo(), is_gun(), is_magazine(), magazine_current(), toolmods(), and type.
Referenced by ammo_current(), ammo_data(), turret_data::ammo_data(), ammo_effects(), ammo_info(), cycle_action(), Character::deactivate_bionic(), avatar_action::fire_wielded_weapon(), gun_damage(), gun_dispersion(), gun_info(), gun_noise(), gun_range(), gun_recoil(), ranged::handle_gun_damage(), is_reloadable_helper(), make_gun_projectile(), Item_modifier::modify(), price(), character_funcs::select_ammo(), target_ui::update_ammo_range_from_gun_mode(), weapon_inventory_preset::weapon_inventory_preset(), and weight().
| itype_id item::ammo_default | ( | bool | conversion = true | ) | const |
Get default ammo used by item or a null id if item does not have a default ammo type.
| conversion | whether to include the effect of any flags or mods which convert the type |
Definition at line 7601 of file item.cpp.
References ammo_types(), ammunition_type::default_ammotype(), string_id< T >::is_empty(), is_magazine(), itype::magazine, string_id< itype >::NULL_ID(), and type.
Referenced by basecamp::add_resource(), turret_data::ammo_current(), crafting::complete_disassemble(), game::dump_stats(), npc::enough_time_to_reload(), inventory::form_from_map(), gun_info(), npc_ai::gun_value(), ideal_ranged_dps(), item(), Item_modifier::modify(), relic_funcs::process_recharge_entry(), gun_actor::shoot(), starting_inv(), iexamine::use_furn_fake_item(), npc_ai::wielded_value(), and debug_menu::wishitem().
| std::set< ammo_effect_str_id > item::ammo_effects | ( | bool | with_ammo = true | ) | const |
Get ammo effects for item optionally inclusive of any resulting from the loaded ammo.
Definition at line 7633 of file item.cpp.
References ammo_data(), itype::gun, gunmods(), is_gun(), and type.
Referenced by turret_data::ammo_effects(), gun_noise(), ranged::handle_gun_damage(), and make_gun_projectile().
| void item::ammo_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 1904 of file item.cpp.
References _, itype::ammo, AMMO_DAMAGE_AP, AMMO_DAMAGE_AP_PROPORTIONAL, AMMO_DAMAGE_DISPERSION, AMMO_DAMAGE_PROPORTIONAL, AMMO_DAMAGE_RANGE, AMMO_DAMAGE_RECOIL, AMMO_DAMAGE_VALUE, ammo_data(), ammo_effect_BLACKPOWDER, ammo_effect_INCENDIARY, ammo_effect_NEVER_MISFIRES, ammo_effect_RECYCLED, islot_ammo::ammo_effects, AMMO_FX_BLACKPOWDER, AMMO_FX_CANTMISSFIRE, AMMO_FX_INCENDIARY, AMMO_FX_RECYCLED, ammo_remaining(), AMMO_REMAINING_OR_TYPES, AMMO_SHAPE, ammo_type(), common_ranged_data::damage, damage_instance::damage_units, common_ranged_data::dispersion, damage_instance::empty(), islot_ammo::force_stat_display, get_ranged_armor_mult(), get_ranged_pierce(), info(), insert_separation_line(), is_ammo(), iteminfo::is_decimal, is_gun(), iteminfo::lower_is_better, om_direction::name(), nname(), iteminfo::no_newline, common_ranged_data::range, islot_ammo::recoil, islot_ammo::shape, sign::space, string_format(), iteminfo_query::test(), and damage_instance::total_damage().
Referenced by info().
| int item::ammo_remaining | ( | ) | const |
Quantity of ammunition currently loaded in tool, gun or auxiliary gunmod.
Definition at line 7387 of file item.cpp.
References item_contents::all_items_top(), ammo_remaining(), charges, contents, flag_USES_BIONIC_POWER(), get_avatar(), has_flag(), is_bandolier(), is_gun(), is_magazine(), is_tool(), magazine_current(), and units::to_kilojoule().
Referenced by game::add_artifact_dreams(), ammo_consume(), character_funcs::ammo_count_for(), ammo_info(), ammo_remaining(), vehicle_part::ammo_remaining(), turret_data::ammo_remaining(), vehicle_part::ammo_set(), ammo_sufficient(), item_funcs::can_be_unloaded(), turret_data::can_reload(), turret_data::can_unload(), firestarter_actor::can_use(), Character::consume_charges(), iuse::cs_lajatang_off(), Character::deactivate_bionic(), display_name(), npc::do_reload(), aim_activity_actor::do_turn(), iuse::ehandcuffs(), iuse::einktabletpc(), fill_with(), ranged::fire_gun(), character_funcs::fmt_wielded_weapon(), iuse::foodperson(), get_remaining_capacity_for_liquid(), getlight_emit(), gun_recoil(), ranged::gunmode_checks_weapon(), iuse::hand_crank(), activity_handlers::hand_crank_do_turn(), Character::has_enough_charges(), ideal_ranged_dps(), vehicle::interact_with(), is_gunmod_compatible(), is_reloadable_helper(), item(), item_action_generator::map_actions_to_items(), Item_modifier::modify(), iuse::multicooker(), iuse::oxytorch(), target_ui::panel_gun_info(), price(), game::process_artifact(), Character::process_items(), relic_funcs::process_recharge(), process_vehicle_items(), item_reload_option::qty(), iuse::radio_on(), avatar_action::reload(), reload(), activity_handlers::repair_item_finish(), item_funcs::shots_remaining(), iuse::tazer2(), tool_info(), units_remaining(), avatar_funcs::unload_item(), charger_tile::update_internal(), iuse::vibe(), activity_handlers::vibe_do_turn(), wants_to_reload(), wants_to_reload_with(), weapon_inventory_preset::weapon_inventory_preset(), and weight().
| int item::ammo_required | ( | ) | const |
Quantity of ammunition consumed per usage of tool or with each shot of gun.
Definition at line 7457 of file item.cpp.
References ammo_types(), itype::charges_to_use(), flag_FIRE_100(), flag_FIRE_20(), flag_FIRE_50(), has_flag(), is_gun(), is_tool(), and type.
Referenced by character_funcs::ammo_count_for(), turret_data::ammo_options(), ammo_sufficient(), firestarter_actor::can_use(), cauterize_actor::can_use(), Character::consume_charges(), salvage_actor::cut_up(), display_name(), npc::do_reload(), ranged::fire_gun(), mattack::frag(), activity_handlers::game_do_turn(), activatable_inventory_preset::get_denial(), gun_recoil(), ranged::gunmode_checks_weapon(), Character::has_enough_charges(), vehicle::interact_with(), activity_handlers::jackhammer_finish(), item_action_generator::map_actions_to_items(), iuse::oxytorch(), activity_handlers::oxytorch_do_turn(), activity_handlers::pickaxe_finish(), iuse::portable_game(), turret_data::prepare_fire(), npc::pretend_fire(), process_tool(), turret_data::query(), activity_handlers::repair_item_finish(), mattack::rifle(), item_funcs::shots_remaining(), mattack::tankgun(), units_sufficient(), inscribe_actor::use(), cauterize_actor::use(), enzlave_actor::use(), wants_to_reload(), and wants_to_reload_with().
Filter setting the ammo for this instance Any existing ammo is removed.
If necessary a magazine is also added.
| ammo | specific type of ammo (must be compatible with item ammo type) |
| qty | maximum ammo (capped by item capacity) or negative to fill to capacity |
Definition at line 590 of file item.cpp.
References itype::ammo, ammo_capacity(), ammo_set(), ammo_types(), ammo_unset(), charges, count(), curammo, debugmsg, flag_NO_UNLOAD(), itype::get_id(), has_flag(), is_gun(), is_magazine(), is_money(), is_null(), string_id< T >::is_null(), is_tool(), item(), itype::magazine, magazine_current(), magazine_default(), magazine_integral(), itype::magazines, put_in(), set_flag(), calendar::turn, type, and typeId().
Referenced by Character::activate_bionic(), ammo_set(), vehicle_part::ammo_set(), mdeath::broken(), npc::check_toggle_cbm(), crafting::complete_disassemble(), vehicle_part::deserialize(), game::dump_stats(), fill_with(), find_reloadable_cbms(), basecamp::form_crafting_inventory(), gun_info(), npc_ai::gun_value(), activity_handlers::hand_crank_do_turn(), vehicle::interact_with(), item(), Item_modifier::modify(), relic_funcs::process_recharge_entry(), gun_actor::shoot(), npc::starting_weapon(), avatar_funcs::unload_item(), target_ui::update_ammo_range_from_gun_mode(), iuse_transform::use(), npc_ai::wielded_value(), and debug_menu::wishitem().
| std::string item::ammo_sort_name | ( | ) | const |
Definition at line 7651 of file item.cpp.
References ammo_type(), ammo_types(), is_ammo(), is_gun(), is_magazine(), is_tool(), and ammunition_type::name().
| bool item::ammo_sufficient | ( | int | qty = 1 | ) | const |
Check if sufficient ammo is loaded for given number of uses.
Check if there is enough ammo loaded in a tool for the given number of uses or given number of gun shots. Using this function for this check is preferred because we expect to add support for items consuming multiple ammo types in the future. Users of this function will not need to be refactored when this happens.
| [in] | qty | Number of uses |
Definition at line 7480 of file item.cpp.
References ammo_remaining(), and ammo_required().
Referenced by can_do_activity_there(), iuse::extinguisher(), ranged::gunmode_checks_weapon(), Character::has_enough_charges(), iuse::jet_injector(), item_action_generator::map_actions_to_items(), mine_activity(), avatar_action::move(), iuse::pheromone(), iuse::portal(), turret_data::query(), iuse::radiocar(), iuse::radiocaron(), examine_item_menu::rate_action_use(), iuse::rm13armor_off(), iuse::shavekit(), gun_actor::shoot(), iuse::stimpack(), and iuse::teleport().
| ammotype item::ammo_type | ( | ) | const |
Ammo type of an ammo item.
Definition at line 7593 of file item.cpp.
References itype::ammo, is_ammo(), string_id< ammunition_type >::NULL_ID(), and type.
Referenced by vehicle::add_item(), ammo_info(), ammo_sort_name(), mdeath::broken(), color_in_inventory(), detonate(), character_funcs::find_ammo_helper(), character_funcs::get_ammo_items(), item_reload_option::qty(), reload(), and npc::value().
| const std::set< ammotype > & item::ammo_types | ( | bool | conversion = true | ) | const |
Set of ammo types (ammunition_type) used by item.
| conversion | whether to include the effect of any flags or mods which convert the type |
Definition at line 7570 of file item.cpp.
References itype::gun, gunmods(), is_gun(), is_magazine(), is_tool(), itype::magazine, itype::tool, toolmods(), and type.
Referenced by vehicle::add_item(), allow_crafting_component(), ammo_default(), turret_data::ammo_options(), ammo_required(), ammo_set(), ammo_sort_name(), mdeath::broken(), item_funcs::can_be_unloaded(), color_in_inventory(), common_ammo_default(), craft_has_charges(), display_name(), avatar_action::fire_wielded_weapon(), get_quality(), avatar_funcs::gunmod_add(), vehicle_part::is_battery(), is_gunmod_compatible(), is_money(), is_reloadable(), is_reloadable_helper(), item(), magazine_compatible(), magazine_default(), magazine_info(), Item_modifier::modify(), price(), relic_funcs::process_recharge_entry(), character_funcs::select_ammo(), set_countdown(), tool_info(), avatar_funcs::unload_item(), npc::value(), and weight().
| item & item::ammo_unset | ( | ) |
Filter removing all ammo from this instance If the item is neither a tool, gun nor magazine is a no-op For items reloading using magazines any empty magazine remains present.
Definition at line 680 of file item.cpp.
References ammo_unset(), charges, item_contents::clear_items(), contents, curammo, is_gun(), is_magazine(), is_tool(), magazine_current(), and magazine_integral().
Referenced by ammo_set(), ammo_unset(), vehicle_part::ammo_unset(), iuse::ehandcuffs(), emit_radio_signal(), npc_ai::gun_value(), and ammobelt_actor::use().
| void item::animal_armor_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 2715 of file item.cpp.
References _, armor_protection_info(), ARMOR_STORAGE, convert_volume(), debug, get_storage(), info(), iteminfo::is_decimal, is_pet_armor(), iteminfo::no_flags, round_up(), sign::space, string_format(), iteminfo_query::test(), and volume_units_abbr().
Referenced by info().
| void item::armor_fit_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 2740 of file item.cpp.
References _, big_sized_big_char, big_sized_human_char, big_sized_small_char, bp_head, covers(), DESCRIPTION_FLAGS_FITS, DESCRIPTION_FLAGS_HELMETCOMPAT, DESCRIPTION_FLAGS_POWERARMOR, DESCRIPTION_FLAGS_POWERARMOR_RADIATIONHINT, DESCRIPTION_FLAGS_SIDED, DESCRIPTION_FLAGS_VARSIZE, DESCRIPTION_IRRADIATION, flag_FIT(), flag_HELMET_COMPAT(), flag_POWERARMOR_EXO(), flag_POWERARMOR_EXTERNAL(), flag_VARSIZE(), get_avatar(), get_encumber(), get_sizing(), has_flag(), human_sized_big_char, human_sized_human_char, human_sized_small_char, info(), irradiation, is_armor(), is_power_armor(), is_sided(), itype_rad_badge, rad_badge_color(), small_sized_big_char, small_sized_human_char, small_sized_small_char, string_format(), iteminfo_query::test(), and typeId().
Referenced by final_info().
| void item::armor_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 2532 of file item.cpp.
References _, body_part_set::any(), ARMOR_BODYPARTS, ARMOR_COVERAGE, ARMOR_ENCUMBRANCE, ARMOR_LAYER, armor_protection_info(), ARMOR_STORAGE, ARMOR_WARMTH, big_sized_small_char, bp_arm_l, bp_arm_r, bp_eyes, bp_foot_l, bp_foot_r, bp_hand_l, bp_hand_r, bp_head, bp_leg_l, bp_leg_r, bp_mouth, bp_torso, convert_volume(), convert_weight(), covers(), debug, flag_AURA(), flag_BELTED(), flag_FIT(), flag_OUTER(), flag_PERSONAL(), flag_SKINTIGHT(), flag_VARSIZE(), flag_WAIST(), format(), get_avatar(), get_coverage(), get_covered_body_parts(), get_encumber(), get_encumber_when_containing(), get_sizing(), get_storage(), get_total_capacity(), get_warmth(), get_weight_capacity_bonus(), get_weight_capacity_modifier(), has_flag(), human_sized_big_char, human_sized_small_char, info(), insert_separation_line(), is_armor(), iteminfo::is_decimal, is_sided(), iteminfo::lower_is_better, iteminfo::no_flags, iteminfo::no_newline, itype::rigid, round_up(), small_sized_big_char, small_sized_human_char, sign::space, string_format(), iteminfo_query::test(), type, volume_units_abbr(), and weight_units().
Referenced by info().
| void item::armor_protection_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 2489 of file item.cpp.
References _, acid_resist(), ARMOR_PROTECTION, bash_resist(), bullet_resist(), itype::can_use(), cut_resist(), damage(), fire_resist(), get_base_env_resist(), get_base_env_resist_w_filter(), get_env_resist(), info(), is_armor(), is_pet_armor(), iteminfo::no_newline, sign::space, iteminfo_query::test(), and type.
Referenced by animal_armor_info(), and armor_info().
| int item::attack_cost | ( | ) | const |
Base number of moves (Creature::moves) that a single melee attack with this items takes.
The actual time depends heavily on the attacker, see melee.cpp.
Definition at line 5181 of file item.cpp.
References bonus_from_enchantments_wielded(), count(), enchant_vals::ITEM_ATTACK_COST, volume(), and weight().
Referenced by Character::attack_cost(), combat_info(), Character::melee_attack(), npc::move_to(), smash(), and ranged::throw_cost().
| double item::average_dps | ( | const player & | guy | ) | const |
return the average dps of the weapon against evaluation monsters
Definition at line 1448 of file item.cpp.
References dps().
Referenced by npc_ai::melee_value().
| damage_instance item::base_damage_melee | ( | ) | const |
All damage types this item deals when used in melee (no skill modifiers etc.
applied).
Definition at line 5244 of file item.cpp.
References damage_melee(), DT_NULL, NUM_DT, and cata::hash64_detail::ret.
| damage_instance item::base_damage_thrown | ( | ) | const |
All damage types this item deals when thrown (no skill modifiers etc.
applied).
Definition at line 5259 of file item.cpp.
References itype::thrown_damage, and type.
Referenced by ranged::throw_item().
| units::volume item::base_volume | ( | ) | const |
Simplified, faster volume check for when processing time is important and exact volume is not.
NOTE: Result is rounded up to next nearest milliliter when working with stackable (count_by_charges) items that have fractional volume per charge. If trying to determine how many of an item can fit in a given space, charges_per_volume should be used instead.
Definition at line 5076 of file item.cpp.
References components, corpse, corpse_volume(), count_by_charges(), is_corpse(), is_craft(), is_null(), cata::hash64_detail::ret, itype::stack_size, type, and itype::volume.
Referenced by burn(), flammable(), and simulate_burn().
| int item::bash_resist | ( | bool | to_self = false | ) | const |
Definition at line 6031 of file item.cpp.
References clothing_mod_type_bash, damage_level(), get_clothing_mod_val(), get_thickness(), is_null(), and made_of_types().
Referenced by armor_inventory_preset::armor_inventory_preset(), armor_protection_info(), anonymous_namespace{armor_layers.cpp}::clothing_protection(), damage_resist(), and sew_advanced_actor::use().
| void item::basic_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 1458 of file item.cpp.
References _, active, age(), arrow, BASE_AMOUNT, BASE_CATEGORY, BASE_CONTENTS, BASE_DEBUG, BASE_ID, BASE_MATERIAL, BASE_MOD_SRC, BASE_REQUIREMENTS, BASE_VOLUME, BASE_WEIGHT, burnt, c_light_blue, charges, colorize(), convert_volume(), convert_weight(), count_by_charges(), craft_data_, damage_, debug, DESCRIPTION, itype::description, display_mod_source, display_object_ids, enumerate_as_string(), flag_STR_DRAW(), g, get_avatar(), get_category(), get_food(), itype::get_id(), get_min_str(), get_owner_name(), get_shelf_life(), snippet_library::get_snippet_by_id(), ranged::get_str_draw_penalty(), get_var(), goes_bad(), has_flag(), has_var(), info(), insert_separation_line(), is_craft(), iteminfo::is_decimal, is_food(), is_medication(), string_id< T >::is_null(), iteminfo::is_three_decimal, item_counter, item_tags, item_vars, last_rot_check, iteminfo::lower_is_better, made_of_types(), itype::min_dex, itype::min_int, itype::min_per, itype::min_skills, om_direction::name(), iteminfo::no_flags, iteminfo::no_newline, none, owner, rot, round_up(), skill_id, snip_id, SNIPPET, sorted_lex(), sign::space, itype::src, string_format(), iteminfo_query::test(), translation::translated(), type, typeId(), volume(), volume_units_abbr(), WEAPON_CATEGORY, itype::weapon_category, weight(), and weight_units().
Referenced by info().
| void item::battery_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3062 of file item.cpp.
References _, itype::battery, info(), info_string(), insert_separation_line(), is_battery(), string_format(), units::to_joule(), units::to_kilojoule(), and type.
Referenced by info().
| void item::bionic_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3275 of file item.cpp.
References _, bionic_data::activated, bionic_data::bash_protec, itype::bionic, body_part_name_as_heading(), bionic_data::bullet_protec, bionic_data::capacity, convert_weight(), bionic_data::cut_protec, DESCRIPTION_CBM_SLOTS, bionic_data::encumbrance, enumerate_as_string(), bionic_data::env_protec, bionic_data::fuel_opts, get_stat_name(), info(), insert_separation_line(), is_bionic(), iteminfo::is_decimal, list_occupied_bps(), iteminfo::no_newline, sorted_lex(), bionic_data::stat_bonus, string_format(), iteminfo_query::test(), units::to_joule(), type, vgettext(), bionic_data::weight_capacity_bonus, bionic_data::weight_capacity_modifier, and weight_units().
Referenced by final_info().
| time_point item::birthday | ( | ) | const |
Definition at line 10026 of file item.cpp.
References bday.
Referenced by iuse::adrenaline_injector(), age(), editmap::edit_itm(), heal_actor::finish_using(), iuse::fish_trap(), iexamine::fvat_full(), in_container(), item_contents::migrate_item(), Item_modifier::modify(), process_fake_mill(), process_fake_smoke(), iuse::purify_smart(), consume_drug_iuse::use(), and iuse::vaccine().
| double item::bonus_from_enchantments | ( | const Character & | owner, |
| double | base, | ||
| enchant_vals::mod | value, | ||
| bool | round = false |
||
| ) | const |
Calculate bonus from enchantments that affect this item only.
Definition at line 6987 of file item.cpp.
References om_direction::add(), get_enchantments(), owner, and cata::hash64_detail::ret.
Referenced by item_armor_enchantment_adjust().
| double item::bonus_from_enchantments_wielded | ( | double | base, |
| enchant_vals::mod | value, | ||
| bool | round = false |
||
| ) | const |
Calculate bonus from enchantments that affect this item only, assume it's wielded and all enchantments' conditions are satisfied.
Definition at line 7006 of file item.cpp.
References om_direction::add(), get_enchantments(), and cata::hash64_detail::ret.
Referenced by attack_cost(), and damage_melee().
| void item::book_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 2897 of file item.cpp.
References _, itype::book, BOOK_MORALECHANGE, BOOK_NUMUNREADCHAPTERS, BOOK_REQUIREMENTS_BEGINNER, BOOK_REQUIREMENTS_INT, BOOK_SKILLRANGE_MAX, BOOK_SKILLRANGE_MIN, BOOK_SUMMARY, BOOK_TIMEPERCHAPTER, BOOK_UNREAD, SkillLevel::can_train(), itype::can_use(), islot_book::chapters, DESCRIPTION_BOOK_ADDITIONAL_RECIPES, DESCRIPTION_BOOK_RECIPES, enumerate_as_string(), get_avatar(), character_funcs::get_book_fun_for(), get_player_character(), get_remaining_chapters(), Character::get_skill_level(), Character::get_skill_level_object(), avatar::has_identified(), info(), insert_separation_line(), islot_book::intel, is_book(), islot_book::recipe_with_description_t::is_hidden(), Character::knows_recipe(), islot_book::level, SkillLevel::level(), iteminfo::lower_is_better, martial_art_learned_from(), martialart_difficulty(), islot_book::recipe_with_description_t::name, martialart::name, Skill::name(), om_direction::name(), iteminfo::no_flags, string_id< T >::obj(), martialart::primary_skill, islot_book::recipe_with_description_t::recipe, islot_book::recipes, islot_book::req, recipe::result_name(), iteminfo::show_plus, islot_book::skill, islot_book::recipe_with_description_t::skill_level, recipe::skill_used, string_format(), iteminfo_query::test(), islot_book::time, type, typeId(), itype::use_methods, and vgettext().
Referenced by info().
| const std::vector< itype_id > & item::brewing_results | ( | ) | const |
The results of fermenting this item.
Definition at line 5951 of file item.cpp.
References itype::brewable, is_brewable(), and type.
Referenced by final_info(), and iexamine::fvat_full().
| time_duration item::brewing_time | ( | ) | const |
Time for this item to be fully fermented.
Definition at line 5946 of file item.cpp.
References itype::brewable, is_brewable(), and type.
Referenced by final_info(), and iexamine::fvat_full().
| int item::bullet_resist | ( | bool | to_self = false | ) | const |
Definition at line 6098 of file item.cpp.
References clothing_mod_type_bullet, damage_level(), get_clothing_mod_val(), get_thickness(), is_null(), and made_of_types().
Referenced by armor_inventory_preset::armor_inventory_preset(), armor_protection_info(), anonymous_namespace{armor_layers.cpp}::clothing_protection(), damage_resist(), and sew_advanced_actor::use().
| bool item::burn | ( | fire_data & | frd | ) |
Burns the item.
Returns true if the item was destroyed.
Definition at line 8284 of file item.cpp.
References active, base_volume(), mtype::burn_into, burnt, charges, corpse, count_by_charges(), get_mtype(), mtype::hp, is_corpse(), string_id< T >::is_null(), string_id< T >::is_valid(), units::legacy_volume_factor, string_id< T >::obj(), roll_remainder(), set_age(), simulate_burn(), itype::stack_size, type, and itype::volume.
Referenced by Character::absorb_hit().
| time_duration item::calc_rot | ( | time_point | time, |
| int | temp | ||
| ) | const |
Returns rot of the item since last rot calculation.
This function should not be called directly. since it does not have all the needed checks or temperature calculations. If you need to calc rot of item call process_rot instead.
| time | Time point to which rot is calculated |
| temp | Temperature at which the rot is calculated |
Definition at line 5651 of file item.cpp.
References flag_FIELD_DRESS(), time_duration::from_seconds(), get_hourly_rotpoints_at_temp(), get_relative_rot(), get_shelf_life(), has_flag(), is_corpse(), last_rot_check, rng(), calendar::start_of_cataclysm, and time.
Referenced by process_rot().
| bool item::can_contain | ( | const item & | it | ) | const |
Can this item have given item/itype as content?
For example, airtight for gas, acidproof for acid etc.
Definition at line 7030 of file item.cpp.
References can_contain(), and type.
Referenced by can_contain().
| bool item::can_contain | ( | const itype & | tp | ) | const |
Definition at line 7036 of file item.cpp.
References itype::container, LIQUID, itype::phase, and type.
| bool item::can_holster | ( | const item & | obj, |
| bool | ignore = false |
||
| ) | const |
Checks if item is a holster and currently capable of storing obj.
| obj | object that we want to holster |
| ignore | only check item is compatible and ignore any existing contents |
Definition at line 8877 of file item.cpp.
References itype::can_use(), contents, use_function::get_actor_ptr(), itype::get_use(), item_contents::num_item_stacks(), ptr(), and type.
| bool item::can_reload_with | ( | const ammotype & | ammo | ) | const |
Returns true if this item can be reloaded with specified ammo type, ignoring currently loaded ammo.
Definition at line 6861 of file item.cpp.
References ammunition_type::default_ammotype(), and is_reloadable_helper().
Referenced by favorite_ammo_or_select(), avatar_funcs::gunmod_add(), and aim_activity_actor::load_RAS_weapon().
| bool item::can_reload_with | ( | const itype_id & | ammo | ) | const |
Returns true if this item can be reloaded with specified ammo item, ignoring currently loaded ammo.
Definition at line 6866 of file item.cpp.
References is_reloadable_helper().
| bool item::can_revive | ( | ) | const |
Whether this is a corpse that can be revived.
Definition at line 5957 of file item.cpp.
References corpse, damage(), flag_FIELD_DRESS(), flag_FIELD_DRESS_FAILED(), flag_PULPED(), flag_QUARTERED(), flag_SKINNED(), has_flag(), mtype::has_flag(), is_corpse(), max_damage(), and MF_REVIVES.
Referenced by active_item_cache::add(), color_in_inventory(), has_rotten_away(), ready_to_revive(), active_item_cache::remove(), basecamp::start_relay_hide_site(), and basecamp::start_setup_hide_site().
| bool item::can_unload_liquid | ( | ) | const |
Returns true if not empty if it's liquid, it's not currently frozen in resealable container.
Definition at line 6850 of file item.cpp.
References contents, item_contents::front(), is_bucket(), is_container_empty(), LIQUID, made_of(), and SOLID.
Referenced by item_funcs::can_be_unloaded(), iexamine::keg(), and avatar_funcs::unload_item().
| int item::casings_count | ( | ) | const |
How many spent casings are contained within this item?
Definition at line 8090 of file item.cpp.
References casings_handle().
Referenced by item_funcs::can_be_unloaded(), and avatar_funcs::unload_item().
| void item::casings_handle | ( | const std::function< bool(item &)> & | func | ) |
Apply predicate to each contained spent casing removing it if predicate returns true.
Definition at line 8102 of file item.cpp.
References item_contents::casings_handle(), contents, and is_gun().
Referenced by casings_count(), avatar_funcs::gunmod_remove(), reload(), and avatar_funcs::unload_item().
| int item::charges_per_volume | ( | const units::volume & | vol | ) | const |
Number of (charges of) this item that fit into the given volume.
May return 0 if not even one charge fits into the volume. Only depends on the type of this item not on its current charge count.
For items not counted by charges, this returns vol / this->volume().
Definition at line 864 of file item.cpp.
References count_by_charges(), debugmsg, INFINITE_CHARGES, itype::stack_size, tname(), type, volume(), and itype::volume.
Referenced by item_stack::amount_can_fit(), Character::can_feed_furnace_with(), vehicle_part::consume_energy(), display_name(), Character::feed_furnace_with(), activity_handlers::fill_liquid_do_turn(), Character::get_acquirable_energy(), get_remaining_capacity_for_liquid(), in_container(), Item_factory::migrate_item(), Item_modifier::modify(), vehicle::print_fuel_indicator(), advanced_inventory::query_charges(), and try_fuel_fire().
| int item::chip_resistance | ( | bool | worst = false | ) | const |
Returns resistance to being damaged by attack against the item itself.
Calculated from item's materials.
| worst | If this is true, the worst resistance is used. Otherwise the best one. |
Definition at line 6192 of file item.cpp.
References made_of_types().
Referenced by Character::handle_melee_wear().
| void item::clear_vars | ( | ) |
Removes all item variables.
Definition at line 1085 of file item.cpp.
References item_vars.
Referenced by iuse::camera(), einkpc_download_memory_card(), and iuse::einktabletpc().
| nc_color item::color | ( | ) | const |
Returns the default color of the item (e.g.
Definition at line 4910 of file item.cpp.
References c_black, itype::color, mtype::color, corpse, is_corpse(), is_null(), and type.
Referenced by map::draw_maptile(), Character::pour_into(), and debug_menu::wishitem().
| nc_color item::color_in_inventory | ( | ) | const |
Returns the color of the item depending on usefulness for the player character, e.g.
differently if it its an unread book or a spoiling food item etc. This should only be used for displaying data, it should not affect game play.
Definition at line 4127 of file item.cpp.
References color_in_inventory(), and get_avatar().
Referenced by color_in_inventory(), colorized_item_name(), inventory_selector_preset::get_color(), read_inventory_preset::get_color(), avatar_funcs::gunmod_add(), game::list_items(), iuse::marloss_seed(), pickup::pick_up(), iuse::seed(), Character::takeoff(), and Character::will_eat().
Returns the color of the item depending on usefulness for the passed player, e.g.
differently if it its an unread book or a spoiling food item etc. This should only be used for displaying data, it should not affect game play.
| for_player | NPC or avatar which would read book. |
Definition at line 4132 of file item.cpp.
References active, allergy, Character::allergy_type(), allergy_weak, ammo_type(), ammo_types(), itype::bionic, Character::bionic_installation_issues(), bloated, itype::book, c_brown, c_cyan, c_dark_gray, c_green, c_light_blue, c_light_gray, c_light_green, c_light_red, c_magenta, c_pink, c_red, c_white, c_yellow, can_revive(), SkillLevel::can_train(), itype::can_use(), cannibalism, itype::container, damage(), edible, fault_bionic_nonsterile, character_funcs::find_ammo_items_or_mags(), flag_LEAK_DAM(), flag_LITCIG(), flag_RADIOACTIVE(), flag_WET(), character_funcs::get_ammo_items(), get_avatar(), get_food(), Character::get_skill_level(), Character::get_skill_level_object(), get_use(), Character::has_bionic(), has_fault(), has_flag(), visitable< T >::has_item_with(), has_own_flag(), Character::has_trait(), inedible, inedible_mutation, is_ammo(), is_armor(), is_bionic(), is_book(), is_corpse(), is_favorite, is_filthy(), is_food(), is_food_container(), is_gun(), is_magazine(), islot_book::level, made_of(), magazine_compatible(), magazine_integral(), Character::magic, martial_art_learned_from(), Character::martial_arts_data, nausea, no_tool, islot_book::req, cata::hash64_detail::ret, rotten, islot_book::skill, learn_spell_actor::spells, player::studied_all_recipes(), too_full, trait_WOOLALLERGY, type, typeId(), ret_val< T >::value(), and Character::will_eat().
| void item::combat_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3398 of file item.cpp.
References _, attack_cost(), Character::attack_cost(), BASE_DAMAGE, BASE_MOVES, BASE_TOHIT, Character::crit_chance(), damage_melee(), debug_mode, DESCRIPTION_APPLICABLEMARTIALARTS, DESCRIPTION_GUNMOD_ADDREACHATTACK, DESCRIPTION_MELEEDMG, DESCRIPTION_MELEEDMG_BASH, DESCRIPTION_MELEEDMG_CRIT, DESCRIPTION_MELEEDMG_CUT, DESCRIPTION_MELEEDMG_MOVES, DESCRIPTION_MELEEDMG_PIERCE, DESCRIPTION_TECHNIQUES, dps(), DT_BASH, DT_CUT, DT_STAB, enumerate_as_string(), flag_REACH3(), flag_REACH_ATTACK(), get_avatar(), has_flag(), info(), insert_separation_line(), iteminfo::is_decimal, is_gunmod(), iteminfo::lower_is_better, itype::m_to_hit, Character::martial_arts_data, iteminfo::no_flags, iteminfo::no_newline, Character::roll_all_damage(), iteminfo::show_plus, sorted_lex(), sign::space, string_format(), techniques, itype::techniques, iteminfo_query::test(), type, damage_instance::type_damage(), and typeId().
Referenced by info().
| itype_id item::common_ammo_default | ( | bool | conversion = true | ) | const |
Get default ammo for the first ammotype common to an item and its current magazine or "NULL" if none exists.
| conversion | whether to include the effect of any flags or mods which convert the type |
Definition at line 7617 of file item.cpp.
References ammo_types(), string_id< T >::is_empty(), itype::magazine, magazine_current(), string_id< itype >::NULL_ID(), and type.
Referenced by gun_info().
| void item::component_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3129 of file item.cpp.
References _, components, components_to_string(), DESCRIPTION_COMPONENTS_MADEFROM, enumerate_as_string(), get_avatar(), get_var(), info(), is_corpse(), is_craft(), none, string_format(), and iteminfo_query::test().
Referenced by info().
| std::string item::components_to_string | ( | ) | const |
List of all components in printable form, empty if this item has no components.
Definition at line 8896 of file item.cpp.
References components, enumerate_as_string(), flag_BYPRODUCT(), and om_direction::name().
Referenced by component_info().
| bool item::conductive | ( | ) | const |
Whether the items is conductive.
Definition at line 6478 of file item.cpp.
References flag_CONDUCTIVE(), flag_NONCONDUCTIVE(), has_flag(), is_null(), and made_of_types().
Referenced by Character::block_hit(), final_info(), and mdefense::zapback().
| int item::contain_monster | ( | const tripoint & | target | ) |
Definition at line 9257 of file iuse.cpp.
References _, g, monster::get_weight(), itype::nname(), mtype::nname(), serialize(), set_var(), string_format(), units::to_milligram(), type, monster::type, and itype::weight.
Referenced by iuse::capture_monster_act().
| void item::container_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3034 of file item.cpp.
References _, c, itype::container, CONTAINER_DETAILS, format_volume(), info(), insert_separation_line(), is_container(), string_format(), iteminfo_query::test(), type, and volume_units_long().
Referenced by info().
| void item::contents_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3543 of file item.cpp.
References _, item_contents::all_items_top(), arrow, c_light_blue, colorize(), contents, convert_volume(), DESCRIPTION_CONTENTS, display_mod_source, display_object_ids, item_contents::empty(), enumerate_as_string(), gunmods(), info(), insert_separation_line(), iteminfo::is_decimal, is_gun(), LIQUID, iteminfo::no_newline, round_up(), sign::space, string_format(), iteminfo_query::test(), toolmods(), translation::translated(), units::quantity< V, U >::value(), and volume_units_abbr().
Referenced by info().
| bool item::contents_made_of | ( | phase_id | phase | ) | const |
If contents nonempty, return true if item phase is same, else false.
Definition at line 6465 of file item.cpp.
References contents, item_contents::empty(), item_contents::front(), and made_of().
Referenced by character_funcs::find_ammo_helper().
Puts the skill in context of the item.
Definition at line 9966 of file item.cpp.
References gun_skill(), base_camps::id, is_gun(), is_melee(), melee_skill(), and skill_weapon.
Referenced by Character::enumerate_unmet_requirements(), and SkillLevelMap::get_skill_level().
Filter converting this instance to another type preserving all other aspects.
| new_type | the type id to convert to |
Definition at line 533 of file item.cpp.
References relic_data, itype::relic_data, and type.
Referenced by map::add_item(), iuse::arrow_flammable(), iuse::c4(), iuse::camera(), iuse::can_goo(), deactivate(), deserialize(), iuse::dive_tank(), einkpc_download_memory_card(), iuse::einktabletpc(), heal_actor::finish_using(), iuse::firecracker(), iuse::firecracker_pack(), iuse::geiger(), iuse::granade(), init_memory_card_with_random_stuff(), io(), iuse::mininuke(), iuse::molotov_lit(), iuse::mp3(), iuse::mp3_on(), iuse::multicooker(), iuse::noise_emitter_off(), iuse::noise_emitter_on(), on_contents_changed(), iuse::pack_item(), process_extinguish(), process_litcig(), process_wet(), iuse::radio_off(), iuse::radio_on(), iuse::radiocar(), iuse::radiocaron(), iuse::rm13armor_off(), iuse::rm13armor_on(), iuse::shocktonfa_off(), iuse::shocktonfa_on(), iuse::solarpack(), iuse::solarpack_off(), Creature::store(), toolweapon_off(), toolweapon_on(), iuse::towel_common(), iuse::unpack_item(), iuse_transform::use(), fireweapon_off_actor::use(), iuse::vortex(), and iuse::water_purifier().
| units::volume item::corpse_volume | ( | const mtype * | corpse | ) | const |
Volume check for corpses, helper for base_volume().
Definition at line 5054 of file item.cpp.
References corpse, corpse_volume(), debugmsg, flag_FIELD_DRESS(), flag_FIELD_DRESS_FAILED(), flag_GIBBED(), flag_QUARTERED(), flag_SKINNED(), has_flag(), and mtype::volume.
Referenced by base_volume(), corpse_volume(), and volume().
| int item::count | ( | ) | const |
If count_by_charges(), returns charges, otherwise 1.
Definition at line 6010 of file item.cpp.
References charges, and count_by_charges().
Referenced by activity_on_turn_move_loot(), map_item_stack::add_at_pos(), allow_crafting_component(), ammo_set(), attack_cost(), Character::compute_nutrient_range(), iuse_location::deserialize(), pickup::act_item::deserialize(), basecamp::distribute_food(), Character::drop(), drop_on_map(), wash_activity_actor::finish(), ranged::fire_gun(), inventory_entry::get_available_count(), json_item_substitution::get_substitution(), gun_set_mode(), io(), is_gunmod_compatible(), is_reloadable_helper(), submap::load(), advanced_inventory::move_all_items(), pick_one_up(), put_into_vehicle(), pickup::reorder_for_dropping(), iuse_location::serialize(), pickup::act_item::serialize(), item_pricing::set_values(), submap::store(), tidy_activity(), and wash_items().
| bool item::count_by_charges | ( | ) | const |
Definition at line 6005 of file item.cpp.
References itype::count_by_charges(), and type.
Referenced by activity_on_turn_wear(), vehicle::add_charges(), vehicle::add_item(), map::add_item_or_charges(), item_stack::amount_can_fit(), base_volume(), basic_info(), burn(), Character::can_eat(), repair_item_actor::can_repair_target(), charges_of_internal(), charges_per_volume(), craft_command::check_item_components_missing(), complete_craft(), crafting::complete_disassemble(), player::consume_items(), count(), craft_has_charges(), recipe::create_byproducts(), recipe::create_results(), display_name(), display_stacked_with(), move_items_activity_actor::do_turn(), throw_activity_actor::do_turn(), mattack::eat_food(), farm_action(), Character::feed_furnace_with(), fetch_activity(), talk_function::field_harvest(), talk_function::field_plant(), iuse_transform::finalize(), emit_actor::finalize(), for_each_item_in_both(), Character::get_acquirable_energy(), recipe::get_consistency_error(), requirement_data::get_folded_list(), iexamine::get_harvest_items(), monexamine::give_items_to(), repair_item_actor::handle_components(), item_comp::has(), talk_function::individual_mission(), io(), repair_inventory_preset::is_shown(), merge_charges(), to_cbc_migration::migration_required(), mod_charges(), mod_damage(), Item_modifier::modify(), advanced_inventory::move_all_items(), move_item(), npc_throw(), pickup::obtain_and_tokenize_items(), pick_one_up(), pickup::pick_up(), activity_handlers::plant_seed_finish(), price(), advanced_inventory::query_charges(), vehicle::reload_seeds(), player::select_item_component(), talk_effect_fun_t::set_u_buy_item(), talk_effect_fun_t::set_u_sell_item(), simulate_burn(), spell_effect::spawn_ethereal_item(), split(), stacks_with(), Character::throw_range(), ranged::throwing_dispersion(), npc_trading::trade(), try_consume(), units_remaining(), units_sufficient(), inventory::update_quality_cache(), use_charges(), volume(), weight(), Character::weight_carried_reduced_by(), and debug_menu::wishitem().
|
static |
Whether the item is counted by charges, this is a static wrapper around count_by_charges, that does not need an items instance.
| bool item::covers | ( | body_part | bp | ) | const |
Whether this item (when worn) covers the given body part.
Definition at line 743 of file item.cpp.
References convert_bp(), and covers().
Referenced by Character::absorb_hit(), armor_fit_info(), armor_info(), Character::block_hit(), Character::can_wear(), check_art_charge_req(), relic_funcs::check_recharge_reqs(), mutation_branch::conflicts_with_item(), covers(), game::dump_stats(), character_funcs::is_bp_immune_to(), on_wear(), map::player_in_field(), character_display::print_encumbrance(), should_combine_bps(), show_armor_layers_ui(), npc::wear_if_wanted(), Character::wear_item(), and mdefense::zapback().
| bool item::covers | ( | const bodypart_id & | bp | ) | const |
Definition at line 748 of file item.cpp.
References get_covered_body_parts(), and body_part_set::test().
| bool item::craft_has_charges | ( | ) |
Definition at line 6015 of file item.cpp.
References ammo_types(), and count_by_charges().
Referenced by crafting::complete_disassemble(), and recipe::create_byproducts().
| int item::cut_resist | ( | bool | to_self = false | ) | const |
Definition at line 6059 of file item.cpp.
References clothing_mod_type_cut, damage_level(), get_clothing_mod_val(), get_thickness(), is_null(), and made_of_types().
Referenced by armor_inventory_preset::armor_inventory_preset(), armor_protection_info(), anonymous_namespace{armor_layers.cpp}::clothing_protection(), damage_resist(), stab_resist(), and sew_advanced_actor::use().
| int item::damage | ( | ) | const |
How much damage has the item sustained?
Definition at line 696 of file item.cpp.
References damage_.
Referenced by armor_protection_info(), mdeath::broken(), repair_item_actor::can_repair_target(), can_revive(), color_in_inventory(), colorized_item_name(), salvage_actor::cut_up(), vehicle_part::damage(), damage_color(), vehicle_part::damage_percent(), damage_symbol(), repair_item_actor::default_action(), veh_interact::do_repair(), durability_indicator(), editmap::edit_itm(), final_info(), get_relative_health(), iuse::gun_repair(), ranged::handle_gun_damage(), vehicle_part::health_percent(), vehicle_part::hp(), monster::init_from_item(), vehicle_part::is_broken(), activity_handlers::lockpicking_finish(), activity_handlers::make_zlave_finish(), vehicle::operate_scoop(), price(), process_blackpowder_fouling(), process_corpse(), repair_item_actor::repair(), activity_handlers::repair_item_finish(), game::save_cyborg(), Character::suffer_from_schizophrenia(), and tname().
| nc_color item::damage_color | ( | ) | const |
Provide color for UI display dependent upon current item damage level.
Definition at line 6263 of file item.cpp.
References c_dark_gray, c_green, c_light_green, c_light_red, c_magenta, c_red, c_yellow, damage(), damage_level(), max_damage(), and min_damage().
Referenced by durability_indicator(), vehicle_part::name(), and veh_utils::repair_part().
| int item::damage_level | ( | int | max | ) | const |
Scale item damage to the given number of levels.
This function is here mostly for back-compatibility. It should not be used when doing continuous math with the damage value: use damage() instead.
For example, for max = 4, min_damage = -1000, max_damage = 4000 damage level -1000 ~ -1 -1 0 0 1 ~ 1333 1 1334 ~ 2666 2 2667 ~ 3999 3 4000 4
| max | Maximum number of levels |
Definition at line 701 of file item.cpp.
References damage_, and max_damage().
Referenced by Character::armor_absorb(), bash_resist(), bullet_resist(), activity_handlers::butcher_finish(), butchery_drops_harvest(), iuse::chainsaw_off(), crafting::complete_disassemble(), iuse::cs_lajatang_off(), cut_resist(), salvage_actor::cut_up(), damage_color(), vehicle_part::damage_level(), damage_melee(), damage_symbol(), veh_interact::do_repair(), durability_indicator(), gun_damage(), gun_dispersion(), avatar_funcs::gunmod_installation_odds(), monster::init_from_item(), vehicle_part::properties_to_item(), ready_to_revive(), repair_item_actor::repair_chance(), game::save_cyborg(), iuse::trimmer_off(), and fireweapon_off_actor::use().
| int item::damage_melee | ( | damage_type | dt | ) | const |
Damage of given type caused when this item is used as melee weapon.
Definition at line 5188 of file item.cpp.
References bonus_from_enchantments_wielded(), damage_level(), DT_BASH, DT_CUT, DT_NULL, DT_STAB, flag_DIAMOND(), flag_REDUCED_BASHING(), gunmods(), has_flag(), is_gun(), is_null(), enchant_vals::ITEM_DAMAGE_BASH, enchant_vals::ITEM_DAMAGE_CUT, enchant_vals::ITEM_DAMAGE_STAB, itype::melee, NUM_DT, and type.
Referenced by base_damage_melee(), combat_info(), weapon_inventory_preset::deals_melee_damage(), character_effects::intimidation(), is_melee(), ma_requirements::is_valid_weapon(), melee_skill(), Character::melee_special_effects(), melee_train(), Character::power_rating(), activity_handlers::pulp_do_turn(), Character::reach_attack(), Character::roll_bash_damage(), Character::roll_cut_damage(), Character::roll_stab_damage(), smash(), and npc::smash_ability().
| int item::damage_resist | ( | damage_type | dt, |
| bool | to_self = false |
||
| ) | const |
Resistance provided by this item against damage type given by an enum.
Definition at line 6371 of file item.cpp.
References acid_resist(), bash_resist(), bullet_resist(), cut_resist(), debugmsg, DT_ACID, DT_BASH, DT_BIOLOGICAL, DT_BULLET, DT_COLD, DT_CUT, DT_ELECTRIC, DT_HEAT, DT_NULL, DT_STAB, DT_TRUE, fire_resist(), NUM_DT, and stab_resist().
Referenced by Character::armor_absorb(), and resistances::resistances().
| std::string item::damage_symbol | ( | ) | const |
Provide prefix symbol for UI display dependent upon current item damage level.
Definition at line 6292 of file item.cpp.
References _, damage(), damage_level(), and max_damage().
Referenced by durability_indicator(), vehicle_part::name(), and veh_utils::repair_part().
Filter converting this instance to the inactive type If the item is either inactive or cannot be deactivated is a no-op.
| ch | character currently possessing or acting upon the item (if any) |
| alert | whether to display any messages |
Definition at line 540 of file item.cpp.
References _, active, Creature::add_msg_if_player(), alert, convert(), is_tool(), m_info, tname(), itype::tool, and type.
Referenced by iuse::note_bionics(), process_tool(), and fireweapon_on_actor::use().
| void item::deserialize | ( | JsonIn & | jsin | ) |
Definition at line 2367 of file savegame_json.cpp.
References JsonObject::allow_omitted_members(), itype::container, contents, convert(), item_contents::empty(), JsonIn::get_object(), JsonObject::has_array(), io(), is_non_resealable_container(), legacy_fast_forward_time(), JsonObject::read(), savegame_loading_version, and type.
Referenced by item::craft_data::deserialize(), inventory::json_load_items(), monster::load(), and release_monster().
| bool item::destroyed_at_zero_charges | ( | ) | const |
Detonates the item and adds remains (if any) to drops.
Returns true if the item actually detonated, potentially destroying other items and invalidating iterators. Should NOT be called on an item on the map, but on a local copy.
Definition at line 8754 of file item.cpp.
References activated_by, item_contents::all_items_top(), itype::ammo, ammo_type(), apply_ammo_effects(), charges, contents, item_contents::empty(), explosion_handler::explosion(), itype::explosion, itype::magazine, visitable< item >::remove_item(), rng(), and type.
Referenced by map::process_fields_in_submap(), and map::smash_items().
| void item::disassembly_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3174 of file item.cpp.
References _, components, DESCRIPTION_COMPONENTS_DISASSEMBLE, DESCRIPTION_COMPONENTS_MADEFROM, recipe::disassembly_requirements(), enumerate_as_string(), time_duration::from_turns(), requirement_data::get_components(), requirement_data::get_qualities(), requirement_data::get_tools(), recipe_dictionary::get_uncraft(), info(), insert_separation_line(), requirement_data::is_empty(), string_format(), iteminfo_query::test(), recipe::time, to_string_approx(), and typeId().
Referenced by info().
| std::string item::display_money | ( | unsigned int | quantity, |
| unsigned int | total, | ||
| const std::optional< unsigned int > & | selected = std::nullopt |
||
| ) | const |
Definition at line 4799 of file item.cpp.
References format_money(), pgettext(), string_format(), and tname().
Referenced by inventory_selector_preset::get_caption(), and selection_column_preset::get_caption().
| std::string item::display_name | ( | unsigned int | quantity = 1 | ) | const |
Returns the item name and the charges or contained charges (if the item can have charges at all).
Calls tname with given quantity and with_prefix being true.
Definition at line 4820 of file item.cpp.
References _, ammo_capacity(), ammo_current(), ammo_remaining(), ammo_required(), ammo_types(), itype::battery, BOTH, c, charges, charges_per_volume(), city_reference::city, overmapbuffer::closest_city(), contains, contents, count_by_charges(), energy_remaining(), flag_RELOAD_AND_SHOOT(), item_contents::front(), get_avatar(), get_chapters(), get_container_capacity(), get_remaining_chapters(), get_side(), get_var(), Character::global_omt_location(), has_flag(), has_infinite_charges(), visitable< item >::has_item(), is_ammo_container(), is_battery(), is_book(), is_container(), is_gun(), is_magazine(), is_map(), is_money(), is_null(), LEFT, ammunition_type::name(), om_direction::name(), itype::nname(), item_contents::num_item_stacks(), num_sides, overmap_buffer, coords::coord_point< Point, Origin, Scale >::raw(), RIGHT, string_format(), tname(), units::to_joule(), calendar::turn, calendar::turn_zero, and type.
Referenced by act_vehicle_unload_fuel(), monexamine::add_armor(), monexamine::attach_bag_to(), veh_interact::can_remove_part(), game_menus::inv::container_for(), inventory_selector_preset::get_caption(), selection_column_preset::get_caption(), liquid_handler::get_liquid_target(), game::handle_action(), handle_problematic_pickup(), pickup::handle_spillable_contents(), inscribe_actor::item_inscription(), game::list_items(), pick_one_up(), pickup::pick_up(), trading_window::update_win(), and musical_instrument_actor::use().
| bool item::display_stacked_with | ( | const item & | rhs, |
| bool | check_components = false |
||
| ) | const |
Whether two items should stack when displayed in a inventory menu.
This is different from stacks_with, when two previously non-stackable items are now stackable and mergeable because, for example, they reaches the same temperature. This is necessary to avoid misleading stacks like "3 items-count-by-charge (5)".
Definition at line 884 of file item.cpp.
References count_by_charges(), and stacks_with().
Referenced by pickup::stack_for_pickup_ui().
| std::map< std::string, double > item::dps | ( | bool | for_display, |
| bool | for_calc | ||
| ) | const |
Definition at line 1443 of file item.cpp.
References dps(), and get_avatar().
| std::map< std::string, double > item::dps | ( | bool | for_display, |
| bool | for_calc, | ||
| const player & | guy | ||
| ) | const |
calculate effective dps against a stock set of monsters.
by default, assume g->u is wielding for_display - include monsters intended for display purposes for_calc - include monsters intended for evaluation purposes for_display and for_calc are inclusive
Definition at line 1428 of file item.cpp.
References dps_comp_monsters, and effective_dps().
Referenced by average_dps(), combat_info(), dps(), and ideal_ranged_dps().
| std::string item::durability_indicator | ( | bool | include_intact = false | ) | const |
Provides a prefix for the durability state of the item.
with ITEM_HEALTH_BAR enabled, returns a symbol with color tag already applied. Otherwise, returns an adjective. if include_intact is true, this provides a string for the corner case of a player with ITEM_HEALTH_BAR disabled, but we need still a string for some reason.
Definition at line 6316 of file item.cpp.
References _, colorize(), damage(), damage_color(), damage_level(), damage_symbol(), flag_CORPSE(), get_base_material(), has_flag(), is_gun(), pgettext(), and string_format().
Referenced by colorized_item_name(), damage_item(), iuse::gun_repair(), repair_item_actor::repair(), and tname().
Calculate the item's effective damage per second past armor when wielded by a character against a monster.
Definition at line 1325 of file item.cpp.
References monster::absorb_hit(), Character::attack_cost(), bp_torso, Character::crit_chance(), damage_unit::damage_multiplier, damage_instance::damage_units, monster::deal_damage_handle_type(), dealt_damage_instance::dealt_dams, Character::encumb(), Character::get_dex(), monster::get_dodge(), Character::get_hit_weapon(), has_technique(), hits_by_accuracy, rapid_strike, Character::roll_all_damage(), Creature::size_melee_penalty(), dealt_damage_instance::total_damage(), and damage_unit::type.
Referenced by dps().
| units::energy item::energy_remaining | ( | ) | const |
Quantity of energy currently loaded in tool or battery.
Definition at line 7378 of file item.cpp.
References energy, and is_battery().
Referenced by display_name(), mod_energy(), process_vehicle_items(), and charger_tile::update_internal().
| int item::engine_displacement | ( | ) | const |
for combustion engines the displacement (cc)
Definition at line 4117 of file item.cpp.
References itype::engine, and type.
Referenced by veh_interact::display_details(), vehicle_part::name(), vehicle::part_vpower_w(), and tname().
| void item::erase_var | ( | const std::string & | name | ) |
Erase the value of the given variable.
Definition at line 1080 of file item.cpp.
References item_vars, and om_direction::name().
Referenced by einkpc_download_memory_card(), iuse::einktabletpc(), inscribe_actor::item_inscription(), mark_chapter_as_read(), move_item(), iuse::multicooker(), process_UPS(), vehicle_part::properties_to_item(), release_monster(), reset_cable(), set_side(), show_photo_selection(), and npc_trading::trade().
| std::set< fault_id > item::faults_potential | ( | ) | const |
What faults can potentially occur with this item?
Definition at line 6804 of file item.cpp.
References itype::faults, and type.
Referenced by vehicle_part::faults_potential(), ranged::handle_gun_damage(), and examine_item_menu::rate_action_mend().
| void item::fill_with | ( | item & | liquid, |
| int | amount = INFINITE_CHARGES |
||
| ) |
Fill item with liquid up to its capacity.
This works for guns and tools that accept liquid ammo.
| liquid | Liquid to fill the container with. |
| amount | Amount to fill item with, capped by remaining capacity |
Definition at line 8568 of file item.cpp.
References ammo_remaining(), ammo_set(), charges, contents, debugmsg, item_contents::front(), get_relative_rot(), get_remaining_capacity_for_liquid(), is_container(), is_container_empty(), is_food_container(), is_reloadable_with(), mod_charges(), on_contents_changed(), put_in(), set_relative_rot(), tname(), and typeId().
Referenced by veh_interact::complete_vehicle(), vehicle_part::fill_with(), advanced_inventory::move_content(), Character::pour_into(), and reload().
| void item::final_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query & | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3626 of file item.cpp.
References _, armor_fit_info(), BASE_BARTER, BASE_PRICE, BASE_RIGIDITY, cata::flat_set< T, Compare, Data >::begin(), bionic_info(), brewing_results(), brewing_time(), itype::can_use(), charges, conductive(), contents, Character::crafting_inventory(), damage(), debug, DESCRIPTION_ACTIVATABLE_TRANSFORMATION, DESCRIPTION_APPLICABLE_RECIPES, DESCRIPTION_BIONIC_ARMOR_INTERFACE, DESCRIPTION_BREWABLE_DURATION, DESCRIPTION_BREWABLE_PRODUCTS, DESCRIPTION_CONDUCTIVITY, DESCRIPTION_FAULTS, DESCRIPTION_FLAGS, DESCRIPTION_GUNMOD_CONSUMABLE, DESCRIPTION_GUNMOD_DISABLESSIGHTS, DESCRIPTION_HOLSTERS, DESCRIPTION_NOTES, DESCRIPTION_RADIO_ACTIVATION, DESCRIPTION_RADIO_ACTIVATION_CHANNEL, DESCRIPTION_RADIO_ACTIVATION_PROC, DESCRIPTION_RADIOACTIVITY_ALWAYS, DESCRIPTION_RADIOACTIVITY_DAMAGED, DESCRIPTION_RECHARGE_NORELOAD, DESCRIPTION_RECHARGE_UPSCAPABLE, DESCRIPTION_RECHARGE_UPSMODDED, DESCRIPTION_TWOHANDED, item_contents::empty(), cata::flat_set< T, Compare, Data >::end(), enumerate_as_string(), faults, flag_CONDUCTIVE(), flag_CONSUMABLE(), flag_DISABLE_SIGHTS(), flag_FIRE_TWOHAND(), flag_LEAK_ALWAYS(), flag_LEAK_DAM(), flag_NO_RELOAD(), flag_RADIO_ACTIVATION(), flag_RADIO_INVOKE_PROC(), flag_RADIO_MOD(), flag_RADIOACTIVE(), flag_RADIOSIGNAL_1(), flag_RADIOSIGNAL_2(), flag_RADIOSIGNAL_3(), flag_RECHARGE(), flag_USE_UPS(), flag_USES_BIONIC_POWER(), time_duration::from_turns(), item_contents::front(), inscribe_actor::gerund, json_flag::get(), use_function::get_actor_ptr(), player::get_available_recipes(), get_avatar(), get_flags(), itype::get_flags(), itype::get_use(), get_var(), has_flag(), has_own_flag(), Character::has_trait(), json_flag::info(), info(), insert_separation_line(), is_armor(), is_brewable(), iteminfo::is_decimal, is_gun(), is_gunmod(), is_null(), is_power_armor(), is_tool(), item_controller, item_vars, itype_id, localized_compare, iteminfo::lower_is_better, made_of(), nname(), iteminfo::no_newline, recipe_subset::of_component(), pgettext(), price(), ptr(), recipe_filter_by_component(), itype::rigid, sign::space, string_format(), iteminfo_query::test(), time, delayed_transform_iuse::time_to_do(), tname(), to_string_clipped(), trait_WOOLALLERGY, iexamine::transform(), type, typeId(), itype::use_methods, and vgettext().
Referenced by info().
| const islot_armor * item::find_armor_data | ( | ) | const |
If this is an armor item, return its armor data.
You should probably not use this function, use the various functions above (like get_storage) to access armor data directly.
Definition at line 6682 of file item.cpp.
References itype::armor, gunmods(), and type.
Referenced by get_base_env_resist(), get_base_env_resist_w_filter(), get_coverage(), get_covered_body_parts(), get_encumber(), get_encumber_when_containing(), get_env_resist(), get_storage(), get_thickness(), get_warmth(), get_weight_capacity_bonus(), get_weight_capacity_modifier(), is_armor(), and is_sided().
| int item::fire_resist | ( | bool | to_self = false, |
| int | base_env_resist = 0 |
||
| ) | const |
Definition at line 6161 of file item.cpp.
References clothing_mod_type_fire, get_clothing_mod_val(), get_env_resist(), is_null(), and made_of_types().
Referenced by armor_inventory_preset::armor_inventory_preset(), armor_protection_info(), anonymous_namespace{armor_layers.cpp}::clothing_protection(), damage_resist(), and sew_advanced_actor::use().
| bool item::flammable | ( | int | threshold = 0 | ) | const |
Whether the items is flammable.
(Make sure to keep this in sync with fire code in fields.cpp)
| threshold | Item is flammable if it provides more fuel than threshold. |
Definition at line 8321 of file item.cpp.
References base_volume(), mat_burn_data::fuel, mat_burn_data::immune, units::legacy_volume_factor, made_of_types(), and mat_burn_data::volume_per_turn.
Referenced by Character::can_feed_furnace_with(), behavior::character_oracle_t::can_make_fire(), and monster::process_turn().
| void item::food_info | ( | const item * | food_item, |
| std::vector< iteminfo > & | info, | ||
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug, | ||
| temperature_flag | temperature | ||
| ) | const |
Definition at line 1670 of file item.cpp.
References _, AEP_SUPER_CLAIRVOYANCE, Character::allergy_type(), bio_digestion, charges, Character::compute_effective_nutrients(), Character::compute_nutrient_range(), corpse, debug, enumerate_as_string(), flag_CANNIBALISM(), flag_HIDDEN_HALLU(), flag_HIDDEN_POISON(), flag_NO_DISPLAY(), flag_NO_PARASITES(), FOOD_CANNIBALISM, FOOD_HALLUCINOGENIC, FOOD_JOY, FOOD_NUTRITION, FOOD_POISON, FOOD_PORTIONS, FOOD_QUENCH, FOOD_ROT, FOOD_ROT_STORAGE, FOOD_SMELL, FOOD_VIT_EFFECTS, FOOD_VITAMINS, format(), Character::fun_for(), g, get_avatar(), get_comestible(), get_freshness_description(), get_shelf_life(), Character::get_skill_level(), get_var(), nutrients::get_vitamin(), goes_bad(), Character::has_artifact_with(), Character::has_bionic(), has_flag(), Character::has_trait(), Character::has_trait_flag(), info(), insert_separation_line(), recipe_dictionary::is_item_on_loop(), is_tainted(), nutrients::kcal, detail::max_value(), minimum_freshness_duration(), mtype::nname(), iteminfo::no_newline, recipe_dict, rotten(), skill_survival, sorted_lex(), sign::space, string_format(), TEMP_FREEZER, TEMP_FRIDGE, TEMP_HEATER, TEMP_NORMAL, TEMP_ROOT_CELLAR, iteminfo_query::test(), to_string_clipped(), trait_CARNIVORE, trait_flag_CANNIBAL(), trait_SAPROVORE, typeId(), VITAMIN, Character::vitamin_rate(), and nutrients::vitamins.
Referenced by info().
| float item::fuel_energy | ( | ) | const |
Returns energy of one charge of this item as fuel for an engine.
Definition at line 6816 of file item.cpp.
References itype::fuel, is_fuel(), and type.
Referenced by Character::burn_fuel(), vehicle_part::consume_energy(), vehicle::consume_fuel(), vehicle::consumption_per_hour(), Character::get_acquirable_energy(), game::on_move_effects(), and Character::passive_power_gen().
| std::string item::fuel_pump_terrain | ( | ) | const |
Returns the string of the id of the terrain that pumps this fuel, if any.
Definition at line 6821 of file item.cpp.
References itype::fuel, is_fuel(), and type.
Referenced by map::place_gas_pump().
| std::vector< std::pair< const recipe *, int > > item::get_available_recipes | ( | const player & | u | ) | const |
Enumerates recipes available from this book and the skill level required to use them.
Definition at line 7115 of file item.cpp.
References itype::book, recipe::difficulty, Character::get_skill_level(), get_var(), has_var(), is_book(), string_id< T >::obj(), islot_book::recipe_with_description_t::recipe, islot_book::recipe_with_description_t::skill_level, recipe::skill_used, and type.
Referenced by avatar::do_read(), and player::get_recipes_from_books().
| int item::get_base_env_resist_w_filter | ( | ) | const |
Returns the base resistance to environmental effects if an item (for example a gas mask) requires a gas filter to operate and this filter is installed.
Used in iuse::gasmask to change protection of a gas mask if it has (or don't has) filters. For other applications use get_env_resist() above.
Definition at line 5777 of file item.cpp.
References islot_armor::env_resist_w_filter, find_armor_data(), is_pet_armor(), itype::pet_armor, and type.
Referenced by armor_protection_info(), iuse::dive_tank(), and iuse::gasmask().
| const material_type & item::get_base_material | ( | ) | const |
Get the basic (main) material of this item.
May return the null-material.
Definition at line 7151 of file item.cpp.
References made_of(), string_id< material_type >::NULL_ID(), and string_id< T >::obj().
Referenced by Character::armor_absorb(), and durability_indicator().
| std::optional< tripoint > item::get_cable_target | ( | Character * | p, |
| const tripoint & | pos | ||
| ) | const |
Gets the point (vehicle tile) the cable is connected to.
Returns nothing if not connected to anything.
Definition at line 9342 of file item.cpp.
References get_map(), get_var(), map::getlocal(), optional_vpart_position::part_with_feature(), and map::veh_at().
Referenced by process_cable().
| const std::vector< comp_selection< tool_comp > > & item::get_cached_tool_selections | ( | ) | const |
Definition at line 10118 of file item.cpp.
References craft_data_.
| const item_category & item::get_category | ( | ) | const |
Definition at line 8691 of file item.cpp.
References itype::category_force, contents, item_contents::empty(), item_contents::front(), get_category(), is_container(), string_id< T >::is_valid(), string_id< T >::obj(), and type.
Referenced by inventory_selector::add_items(), basic_info(), json_talk_topic::gen_responses(), get_category(), inventory_entry::get_category_ptr(), zone_manager::get_near_zone_type_for_item(), is_map(), map_item_stack::map_item_stack_sort(), operator<(), conditional_t< T >::set_has_item_category(), and spoilage_sort_order().
| int item::get_chapters | ( | ) | const |
How many chapters the book has (if any).
Will be 0 if the item is not a book, or if it has no chapters at all. Each reading will "consume" a chapter, if the book has no unread chapters, it's less fun.
Definition at line 7089 of file item.cpp.
References itype::book, and type.
Referenced by display_name(), character_funcs::get_book_fun_for(), get_remaining_chapters(), and io().
| float item::get_clothing_mod_val | ( | clothing_mod_type | type | ) | const |
Definition at line 10143 of file item.cpp.
References CLOTHING_MOD_VAR_PREFIX(), get_var(), clothing_mods::string_from_clothing_mod_type(), and type.
Referenced by acid_resist(), bash_resist(), bullet_resist(), cut_resist(), fire_resist(), get_encumber_when_containing(), get_storage(), and get_warmth().
| const cata::value_ptr< islot_comestible > & item::get_comestible | ( | ) | const |
Definition at line 10124 of file item.cpp.
References itype::comestible, craft_data_, is_craft(), and type.
Referenced by alcohol(), iuse::blech(), can_drink_nectar(), Character::can_eat(), compute_default_effective_vitamins(), game_menus::inv::consume_drink(), Character::consume_effects(), game_menus::inv::consume_food(), Character::consume_med(), basecamp::distribute_food(), Character::eat(), avatar_action::eat_here(), find_auto_consume(), food_info(), Character::fun_for(), get_comestible_fun(), get_shelf_life(), goes_bad(), behavior::character_oracle_t::has_food(), behavior::character_oracle_t::has_water(), is_comestible(), is_food(), is_medication(), med_info(), Character::modify_morale(), iuse::plantblech(), rate_food(), map::rotten_item_spawn(), spoilage_sort_order(), try_consume(), npc::value(), and Character::will_eat().
| int item::get_comestible_fun | ( | ) | const |
Definition at line 5482 of file item.cpp.
References json_flag::get(), get_comestible(), itype::get_flags(), is_comestible(), item_tags, json_flag::taste_mod(), and type.
Referenced by iuse::blech(), basecamp::distribute_food(), mattack::eat_food(), Character::fun_for(), med_info(), rate_food(), and npc::will_accept_from_player().
| const item & item::get_contained | ( | ) | const |
Return a contained item (if any and only one).
Definition at line 7051 of file item.cpp.
References contents, item_contents::empty(), item_contents::front(), and null_item_reference().
Referenced by Character::consume_effects(), basecamp::distribute_food(), trading_window::get_var_trade(), Character::invoke_item(), examine_item_menu::rate_action_use(), ranged::throw_item(), try_consume(), avatar_funcs::use_item(), avatar::wield(), avatar_action::wield(), npc::wield_better_weapon(), and npc::will_accept_from_player().
| units::volume item::get_container_capacity | ( | ) | const |
It returns the total capacity (volume) of the container for liquids.
Definition at line 8401 of file item.cpp.
References itype::container, is_container(), and type.
Referenced by vehicle_part::ammo_capacity(), display_name(), get_remaining_capacity_for_liquid(), get_total_capacity(), is_funnel_container(), Item_factory::migrate_item(), Item_modifier::modify(), and ranged::throw_item().
| requirement_data item::get_continue_reqs | ( | ) | const |
Returns requirement data representing what is needed to resume work on an in progress craft.
Causes a debugmsg and returns empty requirement data if called on a non-craft
Definition at line 975 of file crafting.cpp.
References components, requirement_data::continue_requirements(), craft_data_, debugmsg, is_craft(), and tname().
| std::string item::get_corpse_name | ( | ) |
Returns name of deceased being if it had any or empty string if not.
Definition at line 9914 of file item.cpp.
References corpse_name.
| int item::get_coverage | ( | ) | const |
Returns the relative coverage that this item has when worn.
Values range from 0 (not covering anything, or no armor at all) to 100 (covering the whole body part). Items that cover more are more likely to absorb damage from attacks.
Definition at line 5900 of file item.cpp.
References islot_armor::coverage, and find_armor_data().
Referenced by Character::armor_absorb(), armor_info(), armor_inventory_preset::armor_inventory_preset(), Character::block_ranged_hit(), relic_funcs::check_recharge_reqs(), anonymous_namespace{armor_layers.cpp}::clothing_properties(), clothing_mod::get_mod_val(), character_funcs::is_bp_immune_to(), map::player_in_field(), tutorial_game::post_action(), wind_resistance_from_item_list(), and mdefense::zapback().
| body_part_set item::get_covered_body_parts | ( | ) | const |
Bitset of all covered body parts.
If the bit is set, the body part is covered by this item (when worn). The index of the bit should be a body part, for example:
For testing only a single body part, use covers instead. This function allows you to get the whole covering data in one call.
Definition at line 753 of file item.cpp.
References get_covered_body_parts(), and get_side().
Referenced by npc::adjust_worn(), Character::armor_absorb(), armor_info(), Character::can_swap(), Character::can_wear(), covers(), get_covered_body_parts(), layer_item(), on_wear(), player_morale::on_worn_item_washed(), player_morale::set_worn(), and weather_effect::wet_player().
| body_part_set item::get_covered_body_parts | ( | side | s | ) | const |
Bitset of all covered body parts, from a specific side.
If the bit is set, the body part is covered by this item (when worn). The index of the bit should be a body part, for example:
For testing only a single body part, use covers instead. This function allows you to get the whole covering data in one call.
| s | Specifies the side. Will be ignored for non-sided items. |
Definition at line 758 of file item.cpp.
References BOTH, bp_arm_l, bp_arm_r, bp_foot_l, bp_foot_r, bp_hand_l, bp_hand_r, bp_leg_l, bp_leg_r, bp_torso, islot_armor::covers, find_armor_data(), is_gun(), LEFT, num_sides, body_part_set::reset(), RIGHT, body_part_set::set(), and islot_armor::sided.
| const std::vector< enchantment > & item::get_enchantments | ( | ) | const |
Definition at line 6978 of file item.cpp.
References is_relic(), and relic_data.
Referenced by bonus_from_enchantments(), bonus_from_enchantments_wielded(), process_relic(), and Character::recalculate_enchantment_cache().
| int item::get_encumber | ( | const Character & | p | ) | const |
Returns the encumbrance value that this item has when worn by given player.
Returns 0 if this is can not be worn at all.
Definition at line 5792 of file item.cpp.
References contents, find_armor_data(), units::from_milliliter(), get_encumber_when_containing(), get_storage(), Character::inv, Character::is_worn(), item_contents::item_size_modifier(), islot_armor::max_encumber, islot_armor::storage, units::quantity< V, U >::value(), inventory::volume(), and Character::worn.
Referenced by armor_fit_info(), armor_info(), armor_inventory_preset::armor_inventory_preset(), repair_item_actor::can_repair_target(), Character::can_wear(), anonymous_namespace{armor_layers.cpp}::clothing_properties(), repair_item_actor::default_action(), Character::head_cloth_encumbrance(), Character::item_wear_cost(), layer_item(), tname(), and sew_advanced_actor::use().
| int item::get_encumber_when_containing | ( | const Character & | p, |
| const units::volume & | contents_volume | ||
| ) | const |
Returns the encumbrance value that this item has when worn by given player, when containing a particular volume of contents.
Returns 0 if this can not be worn at all.
Definition at line 5820 of file item.cpp.
References big_sized_small_char, clothing_mod_type_encumbrance, debugmsg, islot_armor::encumber, find_armor_data(), flag_FIT(), flag_VARSIZE(), get_clothing_mod_val(), get_sizing(), get_total_capacity(), has_flag(), human_sized_small_char, is_gun(), islot_armor::max_encumber, itype::rigid, small_sized_big_char, small_sized_human_char, tname(), type, units::quantity< V, U >::value(), and volume().
Referenced by armor_info(), and get_encumber().
| int item::get_env_resist | ( | int | override_base_resist = 0 | ) | const |
Returns the resistance to environmental effects (islot_armor::env_resist) that this item provides when worn.
See player::get_env_resist. Higher values are better. For non-armor it returns 0.
| override_base_resist | Pass this to artifically increase the base resistance, so that the function can take care of other modifications to resistance for you. Note that this parameter will never decrease base resistnace. |
Definition at line 5763 of file item.cpp.
References islot_armor::env_resist, find_armor_data(), get_relative_health(), get_var(), is_pet_armor(), itype::pet_armor, and type.
Referenced by acid_resist(), armor_inventory_preset::armor_inventory_preset(), armor_protection_info(), anonymous_namespace{armor_layers.cpp}::clothing_protection(), fire_resist(), and tutorial_game::post_action().
| struct fuel_explosion item::get_explosion_data | ( | ) |
Definition at line 6831 of file item.cpp.
References type.
Referenced by vehicle::explode_fuel().
| const item::FlagsSetType & item::get_flags | ( | ) | const |
returs read-only set of flags of this item (not including flags from item type or gunmods)
Definition at line 5353 of file item.cpp.
References item_tags.
Referenced by final_info().
| item * item::get_food | ( | ) |
Definition at line 6642 of file item.cpp.
References get_food_impl().
Referenced by basic_info(), color_in_inventory(), npc::consume_food(), npc::decide_needs(), zone_manager::get_near_zone_type_for_item(), and info().
| const item * item::get_food | ( | ) | const |
Definition at line 6647 of file item.cpp.
References get_food_impl().
| int item::get_free_mod_locations | ( | const gunmod_location & | location | ) | const |
Number of mods that can still be installed into the given mod location, for non-guns it always returns 0.
Definition at line 4095 of file item.cpp.
References item_contents::all_items_top(), contents, get_mod_locations(), and is_gun().
Referenced by saw_stock_actor::can_use_on(), gun_info(), avatar_funcs::gunmod_remove(), and is_gunmod_compatible().
| int item::get_gun_ups_drain | ( | ) | const |
Definition at line 9932 of file item.cpp.
References itype::gun, gunmods(), and type.
Referenced by character_funcs::ammo_count_for(), npc::decide_needs(), ranged::fire_gun(), ranged::gunmode_checks_weapon(), turret_data::query(), item_funcs::shots_remaining(), and target_ui::update_ammo_range_from_gun_mode().
| layer_level item::get_layer | ( | ) | const |
Returns clothing layer for item.
Definition at line 5875 of file item.cpp.
References itype::armor, AURA_LAYER, BELTED_LAYER, flag_AURA(), flag_BELTED(), flag_OUTER(), flag_PERSONAL(), flag_SKINTIGHT(), flag_WAIST(), has_flag(), itype::layer, OUTER_LAYER, PERSONAL_LAYER, REGULAR_LAYER, type, UNDERWEAR_LAYER, and WAIST_LAYER.
Referenced by Character::item_wear_cost(), profession::items(), and layer_item().
| const recipe & item::get_making | ( | ) | const |
Get the stored recipe for in progress crafts.
Causes a debugmsg if called on a non-craft and returns the null recipe.
Definition at line 10089 of file item.cpp.
References craft_data_, debugmsg, and tname().
Referenced by iuse::craft(), handle_craft_failure(), and set_next_failure_point().
| int item::get_min_str | ( | ) | const |
Definition at line 10044 of file item.cpp.
References itype::gun, gunmods(), itype::min_str, and type.
Referenced by basic_info(), Character::enumerate_unmet_requirements(), ranged::get_str_draw_penalty(), aim_activity_actor::load_RAS_weapon(), Character::meets_stat_requirements(), ranged::str_draw_damage_modifier(), ranged::str_draw_dispersion_modifier(), and ranged::str_draw_range_modifier().
| std::map< gunmod_location, int > item::get_mod_locations | ( | ) | const |
Get mod locations, including those added by other mods.
Definition at line 4078 of file item.cpp.
References itype::gun, gunmods(), and type.
Referenced by get_free_mod_locations(), gun_info(), avatar_funcs::gunmod_remove(), and is_gunmod_compatible().
| const mtype * item::get_mtype | ( | ) | const |
Definition at line 6625 of file item.cpp.
References corpse.
Referenced by computer_session::action_blood_anal(), burn(), activity_handlers::butcher_finish(), butcher_time_to_cut(), butchery_drops_harvest(), butchery_quarter(), consider_butchery(), editmap::draw_main_ui_overlay(), and game::revive_corpse().
| int item::get_next_failure_point | ( | ) | const |
Get the failure point stored in this item.
returns INT_MAX if the failure point is unset. Causes a debugmsg and returns INT_MAX if called on a non-craft.
Definition at line 895 of file crafting.cpp.
References craft_data_, debugmsg, is_craft(), and tname().
| faction_id item::get_old_owner | ( | ) | const |
Definition at line 1285 of file item.cpp.
References old_owner, and validate_ownership().
Referenced by is_old_owner().
| faction_id item::get_owner | ( | ) | const |
Definition at line 1279 of file item.cpp.
References owner, and validate_ownership().
Referenced by get_owner_name(), handle_pickup_ownership(), is_owned_by(), and query_consume_ownership().
| std::string item::get_owner_name | ( | ) | const |
Definition at line 1261 of file item.cpp.
References debugmsg, g, get_owner(), and tname().
Referenced by basic_info().
| std::string item::get_pet_armor_bodytype | ( | ) | const |
Definition at line 5941 of file item.cpp.
References is_pet_armor(), itype::pet_armor, and type.
| units::volume item::get_pet_armor_max_vol | ( | ) | const |
Definition at line 5931 of file item.cpp.
References is_pet_armor(), itype::pet_armor, and type.
| units::volume item::get_pet_armor_min_vol | ( | ) | const |
Definition at line 5936 of file item.cpp.
References is_pet_armor(), itype::pet_armor, and type.
| time_duration item::get_plant_epoch | ( | ) | const |
Time it takes to grow from one stage to another.
There are 4 plant stages: seed, seedling, mature and harvest. Non-seed items return 0.
Definition at line 9779 of file item.cpp.
References calendar::season_ratio(), itype::seed, and type.
| std::string item::get_plant_name | ( | ) | const |
The name of the plant as it appears in the various informational menus.
This should be translated. Returns an empty string for non-seed items.
Definition at line 9793 of file item.cpp.
References itype::seed, and type.
Referenced by map::rotten_item_spawn().
| int64_t item::get_property_int64_t | ( | const std::string & | prop, |
| int64_t | def = 0 |
||
| ) | const |
Definition at line 5369 of file item.cpp.
References debugmsg, itype::properties, tname(), and type.
Referenced by ranged::throw_item().
| std::string item::get_property_string | ( | const std::string & | prop, |
| const std::string & | def = "" |
||
| ) | const |
Get typed property for item.
Return same type as the passed default value, or string where no default provided
Definition at line 5363 of file item.cpp.
References itype::properties, and type.
Referenced by iuse::capture_monster_act().
| std::map< quality_id, int > item::get_qualities | ( | ) | const |
Definition at line 5430 of file item.cpp.
References get_quality(), itype::qualities, and type.
Referenced by inventory::update_quality_cache().
| int item::get_quality | ( | const quality_id & | id | ) | const |
EXCEPTION: Items with quality BOIL only count as such if they are empty, excluding items of their ammo type if they are tools.
Definition at line 5383 of file item.cpp.
References ammo_types(), item_contents::best_quality(), contents, item_contents::empty(), visitable< item >::has_item_with(), is_tool(), itype::qualities, and type.
Referenced by iuse::clear_rubble(), iuse::crowbar(), dig_pit_moves_and_byproducts(), get_qualities(), bionic::get_quality(), has_quality_internal(), Character::item_with_best_of_quality(), activity_handlers::lockpicking_finish(), max_quality_internal(), and pick_lock_actor::use().
| const material_type & item::get_random_material | ( | ) | const |
Get a material reference to a random material that this item is made of.
This might return the null-material, you may check this with material_type::ident. Note that this may also return a different material each time it's invoked (if the item is made from several materials).
Definition at line 7146 of file item.cpp.
References made_of(), string_id< material_type >::NULL_ID(), and random_entry().
Referenced by Character::armor_absorb().
| float item::get_relative_health | ( | ) | const |
Relative item health.
Returns 1 for undamaged ||items, values in the range (0, 1) for damaged items and values above 1 for reinforced ++items.
Definition at line 6221 of file item.cpp.
References damage(), and max_damage().
Referenced by get_base_env_resist(), and get_env_resist().
| double item::get_relative_rot | ( | ) | const |
Get rot value relative to shelf life (or 0 if item does not spoil)
Definition at line 5531 of file item.cpp.
References get_shelf_life(), and goes_bad().
Referenced by calc_rot(), Character::consume_effects(), fill_with(), Character::fun_for(), comestible_inventory_preset::get_freshness(), get_freshness_description(), get_most_rotten_component(), comestible_inventory_preset::get_time_left(), has_rotten_away(), item(), and rate_food().
| const std::vector< relic_recharge > & item::get_relic_recharge_scheme | ( | ) | const |
Definition at line 7025 of file item.cpp.
References relic_data.
Referenced by relic_funcs::process_recharge().
| int item::get_reload_time | ( | ) | const |
Returns the reload time of the gun.
Returns 0 if not a gun.
Definition at line 6528 of file item.cpp.
References itype::gun, gunmods(), is_gun(), is_magazine(), itype::magazine, and type.
Referenced by ideal_ranged_dps(), Character::item_reload_cost(), and item_reload_option::moves().
| int item::get_remaining_capacity_for_liquid | ( | const item & | liquid, |
| bool | allow_bucket = false, |
||
| std::string * | err = nullptr |
||
| ) | const |
How much more of this liquid (in charges) can be put in this container.
If this is not a container (or not suitable for the liquid), it returns 0. Note that mixing different types of liquid is not possible. Also note that this works for guns and tools that accept liquid ammo.
| liquid | Liquid to check capacity for |
| allow_bucket | Allow filling non-sealable containers |
| err | Message to print if no more material will fit |
Definition at line 8430 of file item.cpp.
References _, ammo_capacity(), ammo_current(), ammo_remaining(), charges, charges_per_volume(), itype::container, contents, item_contents::empty(), detail::digits::error, item_contents::front(), get_container_capacity(), is_bucket(), is_container(), is_reloadable_with(), mapgen_defer::message, string_format(), tname(), type, and typeId().
Referenced by add_rain_to_container(), fill_with(), get_remaining_capacity_for_liquid(), is_container_full(), maple_tree_sap_container(), advanced_inventory::move_content(), Character::pour_into(), item_reload_option::qty(), and reload().
| int item::get_remaining_capacity_for_liquid | ( | const item & | liquid, |
| const Character & | p, | ||
| std::string * | err = nullptr |
||
| ) | const |
Definition at line 8476 of file item.cpp.
References _, charges_per_volume(), get_remaining_capacity_for_liquid(), visitable< T >::has_item(), Character::inv, Character::is_wielding(), itype::rigid, string_format(), tname(), type, Character::volume_capacity(), and Character::volume_carried().
| int item::get_remaining_chapters | ( | const Character & | ch | ) | const |
Get the number of unread chapters.
If the item is no book or has no chapters, it returns 0. This is a per-character setting, different characters may have different number of unread chapters.
Definition at line 7097 of file item.cpp.
References get_chapters(), character_id::get_value(), get_var(), Character::getID(), and string_format().
Referenced by book_info(), display_name(), character_funcs::get_book_fun_for(), and mark_chapter_as_read().
|
inline |
Definition at line 861 of file item.h.
Referenced by butchery_drops_harvest(), and has_rotten_away().
| safe_reference< item > item::get_safe_reference | ( | ) |
Return a pointer-like type that's automatically invalidated if this item is destroyed or assigned-to.
Definition at line 446 of file item.cpp.
References anchor, and safe_reference_anchor::reference_to().
Referenced by active_item_cache::add(), and explosion_handler::ExplosionProcess::move_entity().
| time_duration item::get_shelf_life | ( | ) | const |
Get the shelf life of the item.
Definition at line 5519 of file item.cpp.
References get_comestible(), goes_bad(), is_corpse(), and is_food().
Referenced by basic_info(), calc_rot(), food_info(), get_freshness_description(), get_relative_rot(), process_corpse(), set_relative_rot(), spoilage_sort_order(), and stacks_with().
| side item::get_side | ( | ) | const |
Returns side item currently worn on.
Returns BOTH if item is not sided or no side currently set
Definition at line 808 of file item.cpp.
References BOTH, and get_var().
Referenced by display_name(), get_covered_body_parts(), on_wear(), and swap_side().
| item::sizing item::get_sizing | ( | const Character & | p, |
| bool | wearable | ||
| ) | const |
Definition at line 1177 of file item.cpp.
References big_sized_big_char, big_sized_human_char, big_sized_small_char, flag_OVERSIZE(), flag_UNDERSIZE(), Character::get_size(), has_flag(), human_sized_big_char, human_sized_human_char, human_sized_small_char, MS_HUGE, MS_TINY, not_wearable, small_sized_big_char, small_sized_human_char, and small_sized_small_char.
Referenced by armor_fit_info(), armor_info(), get_encumber_when_containing(), and tname().
| units::volume item::get_storage | ( | ) | const |
Returns the storage amount (islot_armor::storage) that this item provides when worn.
For non-armor it returns 0. The storage amount increases the volume capacity of the character that wears the item.
Definition at line 5732 of file item.cpp.
References clothing_mod_type_storage, find_armor_data(), get_clothing_mod_val(), is_pet_armor(), units::legacy_volume_factor, itype::pet_armor, islot_armor::storage, and type.
Referenced by animal_armor_info(), armor_info(), armor_inventory_preset::armor_inventory_preset(), anonymous_namespace{armor_layers.cpp}::clothing_properties(), get_encumber(), get_total_capacity(), monexamine::give_items_to(), pickup::obtain_and_tokenize_items(), om_carry_weight_to_trips(), tutorial_game::post_action(), pickup::reorder_for_dropping(), Character::takeoff(), and sew_advanced_actor::use().
| std::set< matec_id > item::get_techniques | ( | ) | const |
Returns all the martial art techniques that this items supports.
Definition at line 5475 of file item.cpp.
References techniques, itype::techniques, and type.
Referenced by character_martial_arts::get_all_techniques().
| int item::get_thickness | ( | ) | const |
Returns the islot_armor::thickness value, or 0 for non-armor.
Thickness is are relative value that affects the items resistance against bash / cutting / bullet damage.
Definition at line 5909 of file item.cpp.
References find_armor_data(), is_pet_armor(), itype::pet_armor, islot_armor::thickness, and type.
Referenced by bash_resist(), bullet_resist(), cut_resist(), clothing_mod::get_mod_val(), and tutorial_game::post_action().
| units::volume item::get_total_capacity | ( | ) | const |
It returns the maximum volume of any contents, including liquids, ammo, magazines, weapons, etc.
Definition at line 8409 of file item.cpp.
References use_function::get_actor_ptr(), get_container_capacity(), get_storage(), itype::get_use(), is_bandolier(), is_holster(), and type.
Referenced by armor_info(), and get_encumber_when_containing().
| std::vector< item_comp > item::get_uncraft_components | ( | ) | const |
Returns a list of components used to craft this item or the default components if it wasn't player-crafted.
Definition at line 10057 of file item.cpp.
References components, component::count, recipe::disassembly_requirements(), requirement_data::get_components(), recipe_dictionary::get_uncraft(), cata::hash64_detail::ret, and typeId().
Referenced by disassemble_inventory_preset::disassemble_inventory_preset(), and stacks_with().
| item * item::get_usable_item | ( | const std::string & | use_name | ) |
Checks this item and its contents (recursively) for types that have use_function with type use_name.
Returns the first item that does have such type or nullptr if none found.
Definition at line 7974 of file item.cpp.
References get_use_internal(), NEXT, cata::hash64_detail::ret, SKIP, and visitable< item >::visit_items().
Referenced by game::butcher(), activity_handlers::firstaid_finish(), Character::invoke_item(), activity_handlers::longsalvage_finish(), item_action_generator::map_actions_to_items(), activity_handlers::repair_item_finish(), and activity_handlers::start_fire_finish().
| const use_function * item::get_use | ( | const std::string & | use_name | ) | const |
Returns the pointer to use_function with name use_name assigned to the type of this item or any of its contents.
Checks contents recursively. Returns nullptr if not found.
Definition at line 7948 of file item.cpp.
References ABORT, get_use_internal(), NEXT, SKIP, and visitable< item >::visit_items().
Referenced by active_item_cache::add(), game::butcher(), color_in_inventory(), activity_handlers::firstaid_finish(), iuse_transform::info(), activity_handlers::longsalvage_finish(), item_action_generator::map_actions_to_items(), on_takeoff(), on_wear(), process_tool(), read(), active_item_cache::remove(), activity_handlers::repair_item_finish(), sleep(), activity_handlers::start_fire_finish(), avatar::wield(), avatar_action::wield(), and npc::wield_better_weapon().
|
private |
Definition at line 7966 of file item.cpp.
References itype::get_use(), and type.
Referenced by get_usable_item(), and get_use().
| std::string item::get_var | ( | const std::string & | name | ) | const |
| std::string item::get_var | ( | const std::string & | name, |
| const std::string & | default_value | ||
| ) | const |
Definition at line 1044 of file item.cpp.
References item_vars, om_direction::name(), and string_split().
| double item::get_var | ( | const std::string & | name, |
| double | default_value | ||
| ) | const |
Definition at line 1030 of file item.cpp.
References item_vars, and om_direction::name().
Referenced by basic_info(), iuse::cable_attach(), iuse::camera(), iuse::capture_monster_act(), clear_faults(), component_info(), display_name(), iuse::ehandcuffs(), einkpc_download_memory_card(), iuse::einktabletpc(), final_info(), mdeath::focused_beam(), food_info(), iuse::gasmask(), get_available_recipes(), get_cable_target(), get_clothing_mod_val(), get_env_resist(), get_remaining_chapters(), get_side(), get_var(), gun_get_mode_id(), ranged::handle_gun_damage(), monster::init_from_item(), is_pet_armor(), inscribe_actor::item_inscription(), item_read_extended_photos(), item_save_monsters(), label(), iuse::multicooker(), vehicle_part::name(), on_wield(), process_cable(), process_internal(), process_UPS(), release_monster(), avatar_action::reload(), activity_handlers::reload_finish(), game::revive_corpse(), iuse::rpgdie(), mattack::searchlight(), Character::suffer_from_schizophrenia(), tidy_activity(), tname(), iuse::tow_attach(), npc_trading::trade(), iuse::unfold_generic(), unfold_vehicle_iuse::use(), reveal_map_actor::use(), volume(), and weight().
| int item::get_warmth | ( | ) | const |
Returns the warmth value that this item has when worn.
See player class for temperature related code, or player::warmth. Returned values should be positive. A value of 0 indicates no warmth from this item at all (this is also the default for non-armor).
Definition at line 5918 of file item.cpp.
References clothing_mod_type_warmth, find_armor_data(), get_clothing_mod_val(), and islot_armor::warmth.
Referenced by armor_info(), armor_inventory_preset::armor_inventory_preset(), behavior::character_oracle_t::can_wear_warmer_clothes(), anonymous_namespace{armor_layers.cpp}::clothing_properties(), sew_advanced_actor::use(), and Character::warmth().
| units::mass item::get_weight_capacity_bonus | ( | ) | const |
Returns the weight capacity bonus (islot_armor::weight_capacity_modifier) that this item provides when worn.
For non-armor it returns 0. The bonus is added to the total weight capacity of the character that wears the item.
Definition at line 5754 of file item.cpp.
References find_armor_data(), and islot_armor::weight_capacity_bonus.
Referenced by armor_info().
| float item::get_weight_capacity_modifier | ( | ) | const |
Returns the weight capacity modifier (islot_armor::weight_capacity_modifier) that this item provides when worn.
For non-armor it returns 1. The modifier is multiplied with the weight capacity of the character that wears the item.
Definition at line 5745 of file item.cpp.
References find_armor_data(), and islot_armor::weight_capacity_modifier.
Referenced by armor_info().
| bool item::getlight | ( | float & | luminance, |
| units::angle & | width, | ||
| units::angle & | direction | ||
| ) | const |
Directional light emission of the item.
| luminance | The amount of light (see lightmap.cpp) |
| width | If greater 0, the light is emitted in an arc, this is the angle of it. |
| direction | The direction of the light arc. In degrees. |
Definition at line 8363 of file item.cpp.
References light_emission::direction, units::from_degrees(), getlight_emit(), light, light_emission::luminance, and light_emission::width.
| int item::getlight_emit | ( | ) | const |
How much light (see lightmap.cpp) the item emits (it's assumed to be circular).
Definition at line 8385 of file item.cpp.
References ammo_capacity(), ammo_remaining(), flag_CHARGEDIM(), flag_USE_UPS(), has_flag(), is_tool(), itype::light_emission, and type.
Referenced by Character::active_light(), and getlight().
| bool item::goes_bad | ( | ) | const |
whether an item is perishable (can rot)
Definition at line 5498 of file item.cpp.
References flag_PROCESSING(), get_comestible(), materials::get_rotting(), item_internal::goes_bad_cache_fetch(), item_internal::goes_bad_cache_is_for(), has_flag(), is_corpse(), is_food(), and made_of_any().
Referenced by actualize_rot(), basic_info(), crafting::can_disassemble(), complete_craft(), food_info(), get_most_rotten_component(), get_relative_rot(), get_shelf_life(), goes_bad_after_opening(), item_internal::goes_bad_cache_set(), item(), set_relative_rot(), spoilage_sort_order(), stacks_with(), and tname().
| bool item::goes_bad_after_opening | ( | ) | const |
whether an item is perishable (can rot), even if it is currently in a preserving container
Definition at line 5513 of file item.cpp.
References itype::container, contents, item_contents::empty(), item_contents::front(), goes_bad(), and type.
| std::map< gun_mode_id, gun_mode > item::gun_all_modes | ( | ) | const |
Get all possible modes for this gun inclusive of any attached gunmods.
Definition at line 7839 of file item.cpp.
References gun_mode_REACH, gunmods(), is_gun(), is_gunmod(), prefix, and iexamine::transform().
Referenced by target_ui::action_switch_mode(), npc_ai::best_mode_for_range(), can_fire_turret(), npc::confident_shoot_range(), gun_cycle_mode(), gun_get_mode(), gun_set_mode(), game::handle_action(), and reach_range().
| gun_mode item::gun_current_mode | ( | ) | const |
Get the current mode for this gun (or an invalid mode if item is not a gun)
Definition at line 7898 of file item.cpp.
References gun_get_mode(), and gun_get_mode_id().
Referenced by avatar_action::can_fire_weapon(), aim_activity_actor::do_turn(), target_ui::ensure_ranged_gun_mode(), npc::execute_action(), aim_activity_actor::finish(), fire(), turret_data::fire(), character_funcs::fmt_wielded_weapon(), info(), aim_activity_actor::load_RAS_weapon(), npc::method_of_attack(), target_ui::panel_fire_mode_aim(), target_ui::panel_gun_info(), turret_data::post_fire(), turret_data::prepare_fire(), print_aim(), turret_data::query(), gun_actor::shoot(), target_ui::update_ammo_range_from_gun_mode(), and target_ui::update_status().
| void item::gun_cycle_mode | ( | ) |
Switch to the next available firing mode.
Definition at line 7920 of file item.cpp.
References gun_all_modes(), gun_get_mode_id(), gun_set_mode(), is_gun(), and is_gunmod().
Referenced by target_ui::ensure_ranged_gun_mode(), and game::handle_action().
| damage_instance item::gun_damage | ( | bool | with_ammo = true | ) | const |
Summed ranged damage, armor piercing, and multipliers for both, of a gun, including values from mods.
Returns empty instance on non-gun items.
Definition at line 7280 of file item.cpp.
References ammo_data(), damage_level(), itype::gun, gunmods(), is_gun(), cata::hash64_detail::ret, and type.
Referenced by gun_info(), ideal_ranged_dps(), make_gun_projectile(), and weapon_inventory_preset::weapon_inventory_preset().
| int item::gun_dispersion | ( | bool | with_ammo = true, |
| bool | with_scaling = true |
||
| ) | const |
Summed dispersion of a gun, including values from mods.
Returns 0 on non-gun items.
Definition at line 7233 of file item.cpp.
References itype::ammo, ammo_data(), damage_level(), itype::gun, gunmods(), is_gun(), and type.
Referenced by gun_info().
| gun_mode item::gun_get_mode | ( | const gun_mode_id & | mode | ) | const |
Check if gun supports a specific mode returning an invalid/empty mode if not.
Definition at line 7886 of file item.cpp.
References gun_all_modes(), and is_gun().
Referenced by mattack::frag(), gun_current_mode(), mattack::rifle(), and mattack::tankgun().
| gun_mode_id item::gun_get_mode_id | ( | ) | const |
Get id of mode a gun is currently set to, e.g.
DEFAULT, AUTO, BURST
Definition at line 7903 of file item.cpp.
References get_var(), GUN_MODE_VAR_NAME(), is_gun(), and is_gunmod().
Referenced by target_ui::action_switch_mode(), gun_current_mode(), and gun_cycle_mode().
| void item::gun_info | ( | const item * | mod, |
| std::vector< iteminfo > & | info, | ||
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 2017 of file item.cpp.
References _, ranged::aim_per_move(), itype::ammo, ammo_data(), ammo_default(), AMMO_REMAINING, ammo_set(), AMMO_UPSCOST, damage_unit::amount, ranged::burst_penalty(), common_ammo_default(), curammo, damage_unit::damage_multiplier, damage_instance::damage_units, debugmsg, DESCRIPTION_GUN_CASINGS, DESCRIPTION_GUN_MODS, DT_STAB, ranged::effective_dispersion(), translation::empty(), enumerate_as_string(), flag_BIPOD(), flag_RELOAD_ONE(), ranged::get_aim_types(), get_avatar(), get_free_mod_locations(), get_mod_locations(), get_ranged_pierce(), ranged::get_weapon_dispersion(), GUN_AIMING_STATS, GUN_ALLOWED_MAGAZINES, GUN_ARMORMULT, GUN_ARMORMULT_LOADEDAMMO, GUN_ARMORMULT_TOTAL, GUN_ARMORPIERCE, GUN_ARMORPIERCE_LOADEDAMMO, GUN_ARMORPIERCE_TOTAL, GUN_BURST_PENALTY, GUN_CAPACITY, gun_damage(), GUN_DAMAGE, GUN_DAMAGE_LOADEDAMMO, GUN_DAMAGE_TOTAL, GUN_DAMAGEMULT, GUN_DAMAGEMULT_AMMO, GUN_DAMAGEMULT_TOTAL, GUN_DEFAULT_AMMO, gun_dispersion(), GUN_DISPERSION, GUN_DISPERSION_LOADEDAMMO, GUN_DISPERSION_SIGHT, GUN_DISPERSION_TOTAL, ranged::gun_engagement_moves(), GUN_FIRE_MODES, GUN_MAGAZINE, GUN_MAX_RANGE, gun_range(), gun_recoil(), GUN_RECOIL, GUN_RECOIL_BIPOD, gun_recoil_multiplier(), GUN_RECOIL_PERCENTAGE, GUN_RECOIL_PERCENTAGE_BIPOD, GUN_RELOAD_TIME, GUN_TYPE, GUN_USEDSKILL, gunmods(), has_flag(), info(), insert_separation_line(), iteminfo::is_decimal, iteminfo::lower_is_better, magazine_compatible(), magazine_integral(), dispersion_sources::max(), MAX_RECOIL, itype::name, Skill::name(), itype::nname(), iteminfo::no_flags, iteminfo::no_name, iteminfo::no_newline, none, range, range_with_even_chance_of_good_hit(), damage_unit::res_mult, second, iteminfo::show_plus, sign::space, ranged::str_draw_damage_modifier(), string_format(), iteminfo_query::test(), type, islot_gun::valid_mod_locations, and vgettext().
Referenced by info().
| item::sound_data item::gun_noise | ( | bool | burst = false | ) | const |
Returns the sound of the gun being fired.
| burst | Whether the gun was fired in burst mode (the sound string is usually different). |
Definition at line 1815 of file ranged.cpp.
References _, itype::ammo, ammo_current(), ammo_data(), ammo_effect_LASER, ammo_effect_LIGHTNING, ammo_effect_PLASMA, ammo_effect_WHIP, ammo_effects(), itype::gun, gunmods(), is_gun(), itype_12mm, itype_40x46mm, itype_40x53mm, itype_66mm, itype_84x246mm, itype_arrow, itype_bolt, itype_flammable, itype_m235, itype_metal_rail, noise, and type.
Referenced by is_silent(), ranged::make_gun_sound_effect(), and npc::pretend_fire().
| int item::gun_range | ( | bool | with_ammo = true | ) | const |
Summed range value of a gun, including values from mods.
Returns 0 on non-gun items.
Definition at line 7343 of file item.cpp.
References itype::ammo, ammo_data(), itype::gun, gunmods(), is_gun(), RANGE_HARD_CAP, cata::hash64_detail::ret, and type.
| int item::gun_range | ( | const player * | p | ) | const |
The weapons range in map squares.
If the item has an active gunmod, it returns the range of that gunmod, the guns range is returned only when the item has no active gunmod. This function applies to guns and auxiliary gunmods. For other items, 0 is returned. It includes the range given by the ammo.
| p | The player that uses the weapon, their strength might affect this. It's optional and can be null. |
Definition at line 7362 of file item.cpp.
References gun_range(), Character::meets_requirements(), cata::hash64_detail::ret, and ranged::str_draw_range_modifier().
Referenced by gun_info(), gun_range(), game::list_monsters(), make_gun_projectile(), turret_data::range(), and target_ui::update_ammo_range_from_gun_mode().
| int item::gun_recoil | ( | bool | bipod = false | ) | const |
Get effective recoil considering handling, loaded ammo and effects of attached gunmods.
| bipod | whether any bipods should be considered |
Definition at line 7329 of file item.cpp.
References itype::ammo, ammo_data(), ammo_remaining(), ammo_required(), itype::gun, gun_recoil_multiplier(), is_gun(), and type.
Referenced by calculate_dispersion(), npc::confident_gun_mode_range(), ranged::fire_gun(), and gun_info().
| double item::gun_recoil_multiplier | ( | bool | bipod = false | ) | const |
Get multiplier on recoil considering handling and attached gunmods.
| bipod | whether any bipods should be considered |
Definition at line 7309 of file item.cpp.
References flag_BIPOD(), itype::gun, gunmods(), and type.
Referenced by gun_info(), and gun_recoil().
| bool item::gun_set_mode | ( | const gun_mode_id & | mode | ) |
Try to set the mode for a gun, returning false if no such mode is possible.
Definition at line 7911 of file item.cpp.
References count(), gun_all_modes(), GUN_MODE_VAR_NAME(), is_gun(), is_gunmod(), set_var(), and string_id< T >::str().
Referenced by target_ui::action_switch_mode(), gun_cycle_mode(), avatar_funcs::gunmod_remove(), game::handle_action(), io(), and gun_actor::shoot().
| skill_id item::gun_skill | ( | ) | const |
The skill used to operate the gun.
Can be "null" if this is not a gun.
Definition at line 7187 of file item.cpp.
References itype::gun, is_gun(), string_id< Skill >::NULL_ID(), and type.
Referenced by ranged::aim_cap_from_volume(), ranged::aim_per_move(), ranged::burst_penalty(), holster_actor::can_holster(), contextualize_skill(), ranged::fire_gun(), vehicle::get_targeting_npc(), gun_type(), avatar_funcs::gunmod_installation_odds(), is_gunmod_compatible(), Character::item_store_cost(), on_wield(), holster_actor::store(), and character_funcs::try_wield_contents().
| gun_type_type item::gun_type | ( | ) | const |
Get the type of a ranged weapon (e.g.
"rifle", "crossbow"), or empty string if non-gun
Definition at line 7195 of file item.cpp.
References flag_CROSSBOW(), gun_skill(), has_flag(), is_gun(), and translate_marker_context.
Referenced by is_gunmod_compatible().
Get first attached gunmod matching type or nullptr if no such mod or item is not a gun.
Definition at line 7750 of file item.cpp.
References gunmods().
Referenced by saw_barrel_actor::can_use_on(), saw_stock_actor::can_use_on(), cycle_action(), gunmod_find(), is_gunmod_compatible(), tname(), volume(), and weight().
Definition at line 7759 of file item.cpp.
References gunmod_find().
| void item::gunmod_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 2380 of file item.cpp.
References _, catacurses::black, DESCRIPTION_GUNMOD, DESCRIPTION_GUNMOD_REACH, enumerate_as_string(), flag_REACH_ATTACK(), get_ranged_pierce(), itype::gunmod, GUNMOD_ADD_MOD, GUNMOD_AIMSPEED, GUNMOD_AMMO, GUNMOD_ARMORPIERCE, GUNMOD_BLACKLIST_MOD, GUNMOD_DAMAGE, GUNMOD_DISPERSION, GUNMOD_DISPERSION_SIGHT, GUNMOD_HANDLING, GUNMOD_LOCATION, GUNMOD_RELOAD, GUNMOD_STRENGTH, GUNMOD_USEDON, has_flag(), info(), insert_separation_line(), is_gun(), is_gunmod(), iteminfo::lower_is_better, itype::mod, ammunition_type::name(), iteminfo::show_plus, string_format(), iteminfo_query::test(), and type.
Referenced by info().
| std::vector< item * > item::gunmods | ( | ) |
Returns all gunmods currently attached to this item (always empty if item not a gun)
Definition at line 7740 of file item.cpp.
References contents, and item_contents::gunmods().
Referenced by ammo_capacity(), ammo_data(), ammo_effects(), ammo_types(), item_funcs::can_be_unloaded(), can_reload_item_or_mods(), detach_gunmods_actor::can_use(), saw_barrel_actor::can_use_on(), saw_stock_actor::can_use_on(), contents_info(), damage_melee(), find_armor_data(), character_funcs::fmt_wielded_weapon(), ranged::get_fastest_sight(), get_gun_ups_drain(), get_min_str(), get_mod_locations(), ranged::get_most_accurate_sight(), get_reload_time(), gun_all_modes(), gun_damage(), gun_dispersion(), gun_info(), gun_noise(), gun_range(), gun_recoil_multiplier(), activity_handlers::gunmod_add_finish(), gunmod_find(), avatar_funcs::gunmod_remove(), ranged::handle_gun_damage(), Character::handle_melee_wear(), has_flag(), avatar_funcs::has_mod(), character_funcs::list_ammo(), magazine_compatible(), magazine_default(), magazine_integral(), examine_item_menu::rate_action_reload(), sight_dispersion(), tname(), avatar_funcs::unload_item(), detach_gunmods_actor::use(), volume(), and weight().
| std::vector< const item * > item::gunmods | ( | ) | const |
| bool item::handle_craft_failure | ( | player & | crafter | ) |
Handle failure during crafting.
Destroy components, lose progress, and set a new failure point.
| crafter | the crafting player. |
Definition at line 930 of file crafting.cpp.
References _, player::add_msg_player_or_npc(), player::can_continue_craft(), Character::cancel_activity(), clamp(), components, player::crafting_success_roll(), debugmsg, destroy_random_component(), get_making(), is_craft(), item_counter, rng_exponential(), set_next_failure_point(), tname(), and x_in_y().
| void item::handle_pickup_ownership | ( | Character & | c | ) |
Definition at line 4476 of file item.cpp.
References ACT_PICKUP, c, g, get_owner(), get_player_character(), has_thievery_witness(), string_id< T >::is_null(), is_owned_by(), MAX_VIEW_DISTANCE, NPCATT_NULL, NPCATT_RECOVER_GOODS, owner, Character::pos(), random_entry(), rl_dist(), set_old_owner(), and set_owner().
Referenced by on_pickup(), on_wear(), and on_wield().
|
inline |
Definition at line 1408 of file item.h.
Referenced by Character::can_eat(), and Character::consume_effects().
| bool item::has_clothing_mod | ( | ) | const |
Definition at line 10133 of file item.cpp.
References clothing_mods::get_all(), and has_own_flag().
Referenced by tname().
| bool item::has_effect_when_carried | ( | art_effect_passive | effect | ) | const |
Does the item provide the artifact effect when it is carried?
Definition at line 9757 of file item.cpp.
References item_contents::all_items_top(), itype::artifact, contents, detail::find(), and type.
Referenced by Character::hardcoded_effects(), and Character::has_artifact_with().
| bool item::has_effect_when_wielded | ( | art_effect_passive | effect | ) | const |
Does the item provide the artifact effect when it is wielded?
Definition at line 9739 of file item.cpp.
References itype::artifact, detail::find(), and type.
Referenced by Character::hardcoded_effects().
| bool item::has_effect_when_worn | ( | art_effect_passive | effect | ) | const |
Does the item provide the artifact effect when it is worn?
Definition at line 9748 of file item.cpp.
References itype::artifact, detail::find(), and type.
| bool item::has_explosion_data | ( | ) | const |
Definition at line 6826 of file item.cpp.
References itype::fuel, is_fuel(), and type.
Referenced by vehicle::explode_fuel().
| bool item::has_fault | ( | const fault_id & | fault | ) | const |
Does this item have the specified fault.
Definition at line 5293 of file item.cpp.
References faults.
Referenced by install_bionic_actor::can_use(), color_in_inventory(), bionic_install_preset::get_denial(), bionic_install_surgeon_preset::get_denial(), ranged::handle_gun_damage(), bionic_sterilize_preset::is_shown(), and tname().
| bool item::has_flag | ( | const flag_str_id & | flag | ) | const |
Definition at line 5327 of file item.cpp.
References has_flag(), and string_id< T >::str().
| bool item::has_flag | ( | const std::string & | flag | ) | const |
Definition at line 5303 of file item.cpp.
References json_flag::get(), gunmods(), itype::has_flag(), has_own_flag(), is_gun(), cata::hash64_detail::ret, toolmods(), and type.
Referenced by Character::activate_bionic(), map::add_item(), map::add_item_or_charges(), monexamine::add_leash(), Character::all_items_with_flag(), Character::allergy_type(), npc::alt_attack(), ammo_consume(), ammo_remaining(), ammo_required(), ammo_set(), amount_of_internal(), Character::armor_absorb(), armor_fit_info(), armor_info(), iexamine::autodoc(), autodoc_internal(), basic_info(), mattack::bio_op_disarm(), iuse::blech(), Character::block_hit(), blocking_ability(), Character::burn_fuel(), butcher_time_to_cut(), butchery_drops_harvest(), calc_rot(), iuse::camera(), item_funcs::can_be_unloaded(), Character::can_consume(), can_do_activity_there(), Character::can_eat(), Character::can_feed_furnace_with(), behavior::character_oracle_t::can_make_fire(), repair_item_actor::can_repair_target(), can_revive(), Character::can_swap(), Character::can_takeoff(), Character::can_unwield(), Character::can_use_heal_item(), Character::can_wear(), Character::can_wield(), iuse::capture_monster_act(), iuse::capture_monster_veh(), cast_spell(), check_litcig(), anonymous_namespace{armor_layers.cpp}::clothing_flags_description(), anonymous_namespace{armor_layers.cpp}::clothing_layer(), color_in_inventory(), combat_info(), comestible_inventory_preset::comestible_inventory_preset(), complete_craft(), crafting::complete_disassemble(), Character::compute_effective_nutrients(), Character::compute_nutrient_range(), conductive(), consider_butchery(), Character::consume_charges(), game_menus::inv::consume_drink(), Character::consume_effects(), game_menus::inv::consume_food(), Character::consume_med(), Character::consume_remote_fuel(), vehicle::consumption_per_hour(), corpse_volume(), activity_handlers::cracking_do_turn(), recipe::create_byproducts(), Single_item_creator::create_single(), iexamine::cvdmachine(), cycle_action(), damage_melee(), repair_item_actor::default_action(), iexamine::dimensional_portal(), display_name(), aim_activity_actor::do_turn(), draw_bionics_titlebar(), game::dump_stats(), durability_indicator(), Character::eat(), einkpc_download_memory_card(), iuse::einktabletpc(), emit_radio_signal(), final_info(), character_funcs::find_ammo_helper(), find_auto_consume(), find_food_heater(), Character::find_remote_fuel(), findBestGasDiscount(), ranged::fire_gun(), activity_handlers::fish_do_turn(), character_funcs::fmt_wielded_weapon(), food_info(), inventory::form_from_map(), Character::fun_for(), activity_handlers::game_do_turn(), character_funcs::get_book_fun_for(), activatable_inventory_preset::get_denial(), bionic_sterilize_preset::get_denial(), get_encumber_when_containing(), ranged::get_fastest_sight(), Character::get_fuel_available(), get_layer(), zone_manager::get_near_zone_type_for_item(), get_sizing(), ranged::get_str_draw_penalty(), getlight_emit(), give_item_to(), goes_bad(), gun_info(), iuse::gun_repair(), gun_type(), gunmod_info(), ranged::gunmode_checks_common(), ranged::gunmode_checks_weapon(), iuse::hand_crank(), ranged::handle_gun_damage(), Character::handle_melee_wear(), handle_problematic_pickup(), Character::has_enough_charges(), has_flag(), Character::has_item_with_flag(), Character::head_cloth_encumbrance(), iuse_transform::info(), inherit_flags(), npc_trading::init_buying(), init_memory_card_with_random_stuff(), target_ui::init_window_and_input(), monexamine::insert_battery(), is_ammo_belt(), is_armor(), is_corpse(), is_dangerous(), advanced_inventory_pane::is_filtered(), is_filthy(), is_firearm(), character_funcs::is_fun_to_read(), is_gunmod_compatible(), is_irremovable(), vehicle::is_perpetual_type(), is_pet_armor(), is_power_armor(), is_reloadable(), is_salvageable(), bionic_uninstall_preset::is_shown(), is_two_handed(), is_unarmed_weapon(), ma_requirements::is_valid_character(), ma_requirements::is_valid_weapon(), is_worn_only_with(), item(), Character::item_reload_cost(), mdeath::jabberwock(), layer_item(), magazine_info(), item_action_generator::map_actions_to_items(), Character::meets_stat_requirements(), Character::melee_attack(), melee_skill(), Character::melee_special_effects(), npc_ai::melee_value(), mine_activity(), Item_modifier::modify(), Character::modify_morale(), avatar_action::move(), game_menus::inv::multiwash(), Character::mutation_effect(), iexamine::nanofab(), needs_processing(), iuse::note_bionics(), on_wear(), on_wield(), iuse::pack_cbm(), Character::passive_power_gen(), monexamine::pet_menu(), avatar_action::plthrow(), iuse::poison(), item_category::priority_zone(), process_extinguish(), process_internal(), Character::process_items(), process_litcig(), process_tool(), process_UPS(), process_vehicle_items(), vehicle_part::properties_to_item(), mattack::pull_metal_weapon(), activity_handlers::pulp_do_turn(), item_reload_option::qty(), iuse::radio_mod(), iuse::radiocar(), iuse::radiocontrol(), rate_food(), rcdrive(), reach_range(), ready_to_revive(), reinforceable(), avatar_action::reload(), reload(), activity_handlers::reload_finish(), remove_ammo(), remove_radio_mod(), repair_item_actor::repair(), repaired_with(), game::revive_corpse(), iexamine::safe(), character_funcs::select_ammo(), set_relative_rot(), player_morale::set_worn(), sight_dispersion(), iexamine::sign(), smoker_load_food(), map::spawn_item(), activity_handlers::spellcasting_finish(), activity_handlers::start_fire_do_turn(), starting_clothes(), starting_inv(), ranged::str_draw_damage_modifier(), ranged::str_draw_dispersion_modifier(), ranged::str_draw_range_modifier(), ranged::throw_item(), tname(), tool_info(), iuse::toolmod_attach(), iuse::towel_common(), type_name(), Character::unarmed_attack(), units_remaining(), avatar_funcs::unload_item(), charger_tile::update_internal(), iuse_transform::use(), set_transform_iuse::use(), unpack_actor::use(), cast_spell_actor::use(), Character::use_charges(), iexamine::use_furn_fake_item(), avatar_action::use_item(), avatar_funcs::use_item(), vehicle::use_washing_machine(), npc::value(), volume(), martialart::weapon_valid(), npc::wear_if_wanted(), Character::wear_item(), iuse::weather_tool(), weight(), weather_effect::wet_player(), npc::will_accept_from_player(), and Character::will_eat().
| bool item::has_infinite_charges | ( | ) | const |
Definition at line 9961 of file item.cpp.
References charges, and INFINITE_CHARGES.
Referenced by display_name(), liquid_handler::get_liquid_target(), mod_charges(), and Character::will_eat().
| bool item::has_label | ( | ) | const |
| bool item::has_own_flag | ( | const std::string & | flag | ) | const |
Checks whether item itself has given flag (doesn't check item type or gunmods).
Essentially get_flags().count(f). Works faster than has_flag
Definition at line 5298 of file item.cpp.
References cata::flat_set< T, Compare, Data >::count(), and item_tags.
Referenced by Character::can_eat(), Character::can_wear(), color_in_inventory(), final_info(), has_clothing_mod(), has_flag(), mod_last_rot_check(), on_drop(), tname(), update_clothing_mod_val(), and sew_advanced_actor::use().
| bool item::has_property | ( | const std::string & | prop | ) | const |
Definition at line 5358 of file item.cpp.
References itype::properties, and type.
Referenced by iuse::capture_monster_act(), and ranged::throw_item().
| bool item::has_rotten_away | ( | ) | const |
Whether the item has enough rot that it should get removed.
Regular shelf life perishable foods rot away completely at 2x shelf life. Corpses last 10 days
Definition at line 8795 of file item.cpp.
References can_revive(), get_relative_rot(), get_rot(), is_corpse(), and is_food().
Referenced by process_rot().
| bool item::has_technique | ( | const matec_id & | tech | ) | const |
Whether the item supports a specific martial art technique (either through its type, or through its individual techniques).
Definition at line 5439 of file item.cpp.
References techniques, itype::techniques, and type.
Referenced by blocking_ability(), effective_dps(), character_martial_arts::has_technique(), and mdeath::jabberwock().
| bool item::has_tools_to_continue | ( | ) | const |
Definition at line 10106 of file item.cpp.
References craft_data_.
| bool item::has_use | ( | ) | const |
Returns true if the item has any use function.
Definition at line 7943 of file item.cpp.
References itype::has_use(), and type.
| bool item::has_var | ( | const std::string & | name | ) | const |
Whether the variable is defined at all.
Definition at line 1075 of file item.cpp.
References item_vars, and om_direction::name().
Referenced by map::add_item(), basic_info(), iuse::capture_monster_act(), einkpc_download_memory_card(), get_available_recipes(), has_label(), inscribe_actor::item_inscription(), vehicle_part::name(), iexamine::nanofab(), process_internal(), Character::suffer_from_schizophrenia(), tidy_activity(), tname(), npc_trading::trade(), unfold_vehicle_iuse::use(), and vehicle::use_monster_capture().
Definition at line 2072 of file npcmove.cpp.
References damage_instance::add(), itype::ammo, ammo_capacity(), ammo_current(), ammo_default(), ammo_remaining(), bp_hand_l, bp_hand_r, debugmsg, dps(), Character::encumb(), ranged::get_aim_types(), get_reload_time(), gun_damage(), ranged::gun_engagement_moves(), is_gun(), magazine_integral(), move_cost(), gun_mode::qty, explosion_handler::explosion_funcs::regular(), ranged::time_to_attack(), tname(), and damage_instance::total_damage().
Referenced by npc::check_or_use_weapon_cbm(), and npc_ai::gun_value().
Definition at line 846 of file item.cpp.
References birthday(), charges_per_volume(), invlet, string_id< T >::is_null(), LIQUID, made_of(), and cata::hash64_detail::ret.
Referenced by in_its_container().
| item item::in_its_container | ( | ) | const |
Returns this item into its default container.
If it does not have a default container, returns this. It's intended to be used like
Definition at line 841 of file item.cpp.
References itype::default_container, in_container(), string_id< itype >::NULL_ID(), and type.
Referenced by defense_game::caravan(), crafting::complete_disassemble(), Single_item_creator::create_single(), map::spawn_an_item(), starting_inv(), and debug_menu::wishitem().
| bool item::inc_damage | ( | ) |
same as other inc_damage, but uses DT_NULL as damage type.
Definition at line 6258 of file item.cpp.
References DT_NULL, and inc_damage().
Referenced by inc_damage(), and process_blackpowder_fouling().
| bool item::inc_damage | ( | damage_type | dt | ) |
Increment item damage by itype::damage_scale constrained by max_damage.
| dt | type of damage which may be passed to on_damage callback |
Definition at line 6253 of file item.cpp.
References itype::damage_scale, and mod_damage().
Referenced by iuse::blood_draw(), damage_item(), iuse::firecracker_pack_act(), activity_handlers::gunmod_add_finish(), ranged::handle_gun_damage(), Character::handle_melee_wear(), activity_handlers::lockpicking_finish(), and vehicle::operate_scoop().
| std::vector< iteminfo > item::info | ( | ) | const |
Return all the information about the item and its type as a vector.
This includes the different properties of the itype (if they are visible to the player).
| parts | controls which parts of the iteminfo to return. |
| batch | The batch crafting number to multiply data by |
Definition at line 3971 of file item.cpp.
References info(), iteminfo_query::no_conditions, and TEMP_NORMAL.
Referenced by advanced_inventory::action_examine(), ammo_info(), animal_armor_info(), armor_fit_info(), armor_info(), armor_protection_info(), basic_info(), battery_info(), bionic_info(), book_info(), combat_info(), game_menus::inv::compare(), component_info(), container_info(), contents_info(), disassembly_info(), final_info(), food_info(), gun_info(), gunmod_info(), info(), info_string(), game::list_items(), magazine_info(), med_info(), qualities_info(), wish_item_callback::refresh(), repair_info(), examine_item_menu::run(), trading_window::show_item_data(), and tool_info().
| std::vector< iteminfo > item::info | ( | const iteminfo_query & | parts, |
| int | batch, | ||
| temperature_flag | temperature | ||
| ) | const |
Definition at line 3986 of file item.cpp.
References _, ammo_info(), animal_armor_info(), armor_info(), basic_info(), battery_info(), book_info(), combat_info(), component_info(), container_info(), contents, contents_info(), debug, debug_mode, DESCRIPTION_AUX_GUNMOD_HEADER, DESCRIPTION_USE_METHODS, disassembly_info(), final_info(), food_info(), item_contents::front(), g, get_food(), gun_current_mode(), gun_info(), gunmod_info(), info(), insert_separation_line(), is_gun(), is_gunmod(), is_med_container(), is_medication(), is_null(), magazine_info(), med_info(), qualities_info(), repair_info(), string_format(), iteminfo_query::test(), tname(), tool_info(), type, and itype::use_methods.
| std::vector< iteminfo > item::info | ( | int | batch | ) | const |
Definition at line 3976 of file item.cpp.
References info(), iteminfo_query::no_conditions, and TEMP_NORMAL.
| std::vector< iteminfo > item::info | ( | temperature_flag | temperature | ) | const |
| std::string item::info_string | ( | ) | const |
As info, but as a string rather than a vector of properties.
Definition at line 4066 of file item.cpp.
References iteminfo_query::all, and info_string().
Referenced by battery_info(), colorized_item_description(), draw_caravan_items(), and info_string().
| std::string item::info_string | ( | const iteminfo_query & | parts, |
| int | batch = 1, |
||
| temperature_flag | temperature = temperature_flag::TEMP_NORMAL |
||
| ) | const |
Definition at line 4071 of file item.cpp.
References format_item_info(), and info().
Inherit applicable flags from the given parent item.
| parent | Item to inherit from |
Definition at line 984 of file crafting.cpp.
References flag_FIT(), flag_HIDDEN_POISON(), flag_NO_RESIZE(), flag_VARSIZE(), json_flag::get(), itype::get_flags(), has_flag(), recipe::has_flag(), item_tags, poison, set_flag(), type, and unset_flag().
Referenced by complete_craft(), and inherit_flags().
Inherit applicable flags from the given list of parent items.
| parents | Items to inherit from |
Definition at line 1012 of file crafting.cpp.
References inherit_flags(), and visitable< item >::parents().
| void item::io | ( | Archive & | archive | ) |
Definition at line 2188 of file savegame_json.cpp.
References active, bday, burnt, itype::can_have_charges(), charges, components, convert(), corpse, corpse_name, count(), cata::flat_set< T, Compare, Data >::count(), count_by_charges(), craft_data_, curammo, damage_, itype::damage_scale, debugmsg, light_emission::direction, energy, erase_if(), faults, frequency, charge_removal_blacklist::get(), json_flag::get(), get_chapters(), itype::get_id(), gun_set_mode(), base_camps::id, itype::id, invlet, irradiation, is_corpse(), is_favorite, is_food(), item(), item_controller, item_counter, item_tags, item_vars, itype_id, itype_rad_badge, itype_radio, itype_radio_on, last_rot_check, light, load_legacy_craft_data(), light_emission::luminance, max_damage(), snippet_library::migrate_hash_to_id(), min_damage(), mission_id, mtype_id, nolight, string_id< translation >::NULL_ID(), string_id< T >::NULL_ID(), old_owner, owner, player_id, poison, recipe_charges, relic_data, snip_id, SNIPPET, itype::snippet_category, calendar::start_of_cataclysm, string_id< T >::str(), cata::swap(), techniques, type, typeId(), and light_emission::width.
Referenced by deserialize(), and serialize().
| bool item::is_ammo | ( | ) | const |
Definition at line 6582 of file item.cpp.
References itype::ammo, and type.
Referenced by vehicle::add_item(), avatar_funcs::add_or_drop_with_msg(), ammo_data(), ammo_info(), ammo_sort_name(), ammo_type(), color_in_inventory(), destroyed_at_zero_charges(), Character::i_add(), Character::i_add_to_container(), is_ammo_container(), Character::item_reload_cost(), tutorial_game::post_action(), item_reload_option::qty(), and npc::value().
| bool item::is_ammo_belt | ( | ) | const |
Definition at line 6567 of file item.cpp.
References flag_MAG_BELT(), has_flag(), and is_magazine().
Referenced by Character::can_reload(), item_reload_option::item_reload_option(), avatar_action::reload(), reload(), and avatar_funcs::unload_item().
| bool item::is_ammo_container | ( | ) | const |
Definition at line 6662 of file item.cpp.
References contents, item_contents::empty(), item_contents::front(), is_ammo(), and is_magazine().
Referenced by display_name(), character_funcs::find_ammo_helper(), Character::i_add_to_container(), Character::item_reload_cost(), item_reload_option::qty(), avatar_action::reload(), reload(), character_funcs::select_ammo(), and item_pricing::set_values().
| bool item::is_armor | ( | ) | const |
Definition at line 6704 of file item.cpp.
References find_armor_data(), flag_IS_ARMOR(), and has_flag().
Referenced by armor_fit_info(), armor_info(), armor_protection_info(), Character::can_wear(), debug_menu::character_edit_menu(), check_art_charge_req(), relic_funcs::check_recharge_reqs(), color_in_inventory(), iuse::directional_hologram(), final_info(), give_item_to(), handle_problematic_pickup(), Character::i_add(), wear_inventory_preset::is_shown(), take_off_inventory_preset::is_shown(), iexamine::nanofab(), tutorial_game::post_action(), game::process_artifact(), examine_item_menu::rate_action_takeoff(), examine_item_menu::rate_action_use(), examine_item_menu::rate_action_wear(), resistances::resistances(), iuse::solarpack(), tname(), and npc::wear_if_wanted().
| bool item::is_artifact | ( | ) | const |
Definition at line 6968 of file item.cpp.
References itype::artifact, and type.
Referenced by game::add_artifact_dreams(), iuse::artifact(), needs_processing(), and process_artifact().
| bool item::is_bandolier | ( | ) | const |
Definition at line 6572 of file item.cpp.
References itype::can_use(), and type.
Referenced by ammo_capacity(), ammo_remaining(), item_funcs::can_be_unloaded(), get_total_capacity(), is_reloadable(), avatar_action::reload(), bandolier_actor::reload(), and avatar_funcs::unload_item().
| bool item::is_battery | ( | ) | const |
Definition at line 6562 of file item.cpp.
References itype::battery, and type.
Referenced by battery_info(), display_name(), energy_remaining(), and mod_energy().
| bool item::is_bionic | ( | ) | const |
Definition at line 6552 of file item.cpp.
References itype::bionic, and type.
Referenced by bionic_info(), install_bionic_actor::can_use(), color_in_inventory(), Character::invoke_item(), bionic_install_preset::is_shown(), bionic_install_surgeon_preset::is_shown(), bionic_sterilize_preset::is_shown(), iuse::note_bionics(), iuse::pack_cbm(), and tname().
| bool item::is_book | ( | ) | const |
Definition at line 6709 of file item.cpp.
References itype::book, and type.
Referenced by book_info(), character_effects::calc_focus_equilibrium(), npc::can_read(), color_in_inventory(), display_name(), get_available_recipes(), character_funcs::get_book_fun_for(), avatar::get_book_reader(), Character::i_add(), read_inventory_preset::is_shown(), examine_item_menu::rate_action_read(), examine_item_menu::rate_action_use(), activity_handlers::read_do_turn(), tname(), avatar_funcs::use_item(), and npc::value().
| bool item::is_brewable | ( | ) | const |
Definition at line 6603 of file item.cpp.
References itype::brewable, and type.
Referenced by brewing_results(), brewing_time(), final_info(), iexamine::fvat_empty(), and iexamine::fvat_full().
| bool item::is_bucket | ( | ) | const |
Definition at line 6734 of file item.cpp.
References itype::container, and type.
Referenced by can_unload_liquid(), get_remaining_capacity_for_liquid(), is_bucket_nonempty(), is_container_eligible_for_crafting(), is_funnel_container(), pick_one_up(), and iexamine::tree_maple_tapped().
| bool item::is_bucket_nonempty | ( | ) | const |
Definition at line 6745 of file item.cpp.
References is_bucket(), and is_container_empty().
Referenced by vehicle::add_item(), empty_buckets(), handle_problematic_pickup(), pickup::handle_spillable_contents(), and on_pickup().
| bool item::is_comestible | ( | ) | const |
Definition at line 6587 of file item.cpp.
References get_comestible().
Referenced by Character::can_consume_as_is(), Character::compute_effective_nutrients(), Character::compute_nutrient_range(), game_menus::inv::consume_drink(), Character::consume_effects(), game_menus::inv::consume_food(), Character::fun_for(), get_comestible_fun(), comestible_inventory_preset::get_edible_comestible(), is_food(), is_medication(), process_internal(), spell_effect::spawn_ethereal_item(), and stacks_with().
| bool item::is_container | ( | ) | const |
Whether this is container.
Note that container does not necessarily means it's suitable for liquids.
Definition at line 6719 of file item.cpp.
References itype::container, and type.
Referenced by item_funcs::can_be_unloaded(), veh_interact::complete_vehicle(), npc::consume_cbm_items(), Character::consume_effects(), Character::consume_item(), container_info(), display_name(), fill_with(), character_funcs::find_ammo_helper(), character_funcs::fmt_wielded_weapon(), get_category(), get_container_capacity(), get_remaining_capacity_for_liquid(), trading_window::get_var_trade(), give_item_to(), is_reloadable(), comestible_inventory_preset::is_shown(), Character::item_reload_cost(), Item_factory::migrate_item(), advanced_inventory::move_content(), needs_processing(), operator<(), reload(), item_pricing::set_values(), spill_contents(), ranged::throw_item(), try_consume(), avatar_funcs::unload_item(), and npc::will_accept_from_player().
| bool item::is_container_empty | ( | ) | const |
Whether this item has no contents at all.
Definition at line 6837 of file item.cpp.
References contents, and item_contents::empty().
Referenced by activatable_inventory_preset::activatable_inventory_preset(), advanced_inventory_pane::add_items_from_area(), Character::can_consume(), can_unload_liquid(), fill_with(), character_funcs::find_ammo_helper(), Character::get_consumable_from(), comestible_inventory_preset::get_denial(), activatable_inventory_preset::get_denial(), is_bucket_nonempty(), is_container_full(), advanced_inv_area::is_container_valid(), is_reloadable_helper(), iexamine::keg(), advanced_inventory::move_content(), pick_one_up(), examine_item_menu::rate_action_use(), character_funcs::select_ammo(), advanced_inv_area::set_container(), spill_contents(), iexamine::tree_maple_tapped(), and avatar_funcs::use_item().
| bool item::is_container_full | ( | bool | allow_bucket = false | ) | const |
Whether this item has no more free capacity for its current content.
| allow_bucket | Allow filling non-sealable containers |
Definition at line 6842 of file item.cpp.
References contents, item_contents::front(), get_remaining_capacity_for_liquid(), and is_container_empty().
Referenced by is_container_eligible_for_crafting(), is_reloadable_helper(), and avatar_action::reload().
| bool item::is_corpse | ( | ) | const |
Whether this is a corpse item.
Corpses always have valid monster type (corpse) associated (get_mtype return a non-null pointer) and have been created with make_corpse.
Definition at line 6620 of file item.cpp.
References corpse, flag_CORPSE(), and has_flag().
Referenced by base_volume(), burn(), activity_handlers::butcher_finish(), calc_rot(), can_revive(), color(), color_in_inventory(), component_info(), zone_manager::get_near_zone_type_for_item(), get_shelf_life(), goes_bad(), has_rotten_away(), io(), made_of(), on_damage(), process_internal(), map::process_items_in_vehicle(), processing_speed(), game::revive_corpse(), tname(), volume(), and weight().
| bool item::is_craft | ( | ) | const |
Definition at line 6923 of file item.cpp.
References craft_data_.
Referenced by base_volume(), basic_info(), Character::can_eat(), component_info(), Character::consume_item(), iuse::craft(), find_auto_consume(), get_comestible(), get_continue_reqs(), activatable_inventory_preset::get_denial(), get_next_failure_point(), handle_craft_failure(), is_food_container(), set_next_failure_point(), stacks_with(), tname(), avatar_funcs::use_item(), volume(), and weight().
| bool item::is_dangerous | ( | ) | const |
Definition at line 9801 of file item.cpp.
References item_contents::all_items_top(), contents, flag_DANGEROUS(), and has_flag().
Referenced by give_item_to(), and npc::value().
| bool item::is_deployable | ( | ) | const |
Definition at line 6953 of file item.cpp.
References itype::can_use(), and type.
Referenced by Character::invoke_item().
| bool item::is_emissive | ( | ) | const |
Whether the item emits any light at all.
Definition at line 6948 of file item.cpp.
References light, itype::light_emission, light_emission::luminance, and type.
Referenced by submap::load(), map::update_lum(), submap::update_lum_add(), and submap::update_lum_rem().
| bool item::is_engine | ( | ) | const |
Definition at line 6750 of file item.cpp.
References itype::engine, and type.
Referenced by is_faulty(), and tname().
| bool item::is_faulty | ( | ) | const |
Definition at line 6770 of file item.cpp.
References faults, and is_engine().
Referenced by clear_faults(), and vehicle_part::name().
| bool item::is_filthy | ( | ) | const |
Marks the item as filthy, so characters with squeamish trait can't wear it.
Definition at line 9981 of file item.cpp.
References flag_FILTHY(), get_avatar(), has_flag(), Character::has_trait(), and trait_SQUEAMISH.
Referenced by Character::can_wear(), color_in_inventory(), crafting::complete_disassemble(), salvage_actor::cut_up(), repair_item_actor::handle_components(), item_category::priority_zone(), activity_handlers::reload_finish(), tname(), avatar_funcs::unload_item(), and heal_actor::use().
| bool item::is_firearm | ( | ) | const |
Does it require gunsmithing tools to repair.
Definition at line 6522 of file item.cpp.
References has_flag(), and is_gun().
Referenced by repair_item_actor::can_repair_target(), iuse::gun_repair(), and repair_inventory_preset::is_shown().
| bool item::is_food | ( | ) | const |
Definition at line 6592 of file item.cpp.
References get_comestible(), and is_comestible().
Referenced by npc::activate_item(), map::add_item(), basic_info(), color_in_inventory(), complete_craft(), Character::consume_charges(), destroyed_at_zero_charges(), basecamp::distribute_food(), Character::eat(), mattack::eat_food(), find_auto_consume(), get_shelf_life(), goes_bad(), behavior::character_oracle_t::has_food(), has_rotten_away(), behavior::character_oracle_t::has_water(), Character::i_add(), io(), is_food_container(), item(), iexamine::keg(), needs_processing(), tutorial_game::post_action(), process_internal(), map::process_items_in_vehicle(), processing_speed(), examine_item_menu::rate_action_use(), tname(), try_consume(), avatar_funcs::use_item(), and npc::value().
| bool item::is_food_container | ( | ) | const |
Definition at line 6608 of file item.cpp.
References contents, craft_data_, item_contents::empty(), item_contents::front(), is_craft(), and is_food().
Referenced by color_in_inventory(), avatar_action::eat(), fill_with(), zone_manager::get_near_zone_type_for_item(), Character::i_add(), vehicle_part::process_contents(), map::process_items_in_vehicle(), and processing_speed().
|
inline |
an item is fresh if it is capable of rotting but still has a long shelf life remaining
Definition at line 840 of file item.h.
Referenced by comestible_inventory_preset::get_freshness(), get_freshness_description(), and tname().
| bool item::is_fuel | ( | ) | const |
Definition at line 6760 of file item.cpp.
References itype::fuel, and type.
Referenced by Character::can_fuel_bionic_with(), vehicle_part::consume_energy(), fuel_energy(), fuel_pump_terrain(), and has_explosion_data().
| bool item::is_funnel_container | ( | units::volume & | bigger_than | ) | const |
Funnel related functions.
See weather.cpp for their usage.
Definition at line 6928 of file item.cpp.
References contents, item_contents::empty(), item_contents::front(), get_container_capacity(), is_bucket(), is_watertight_container(), itype_water, itype_water_acid, itype_water_acid_weak, and typeId().
|
inline |
an item is about to become rotten when shelf life has nearly elapsed
Definition at line 845 of file item.h.
Referenced by get_freshness_description(), comestible_inventory_preset::get_time_left_rounded(), and tname().
| bool item::is_gun | ( | ) | const |
Can this item be used to perform a ranged attack?
Definition at line 6517 of file item.cpp.
References itype::gun, and type.
Referenced by vehicle::add_item(), ranged::aim_per_move(), allow_crafting_component(), ammo_capacity(), ammo_consume(), character_funcs::ammo_count_for(), ammo_data(), ammo_effects(), ammo_info(), ammo_remaining(), ammo_required(), ammo_set(), ammo_sort_name(), ammo_types(), ammo_unset(), npc_ai::best_mode_for_range(), can_fire_turret(), avatar_action::can_fire_weapon(), saw_barrel_actor::can_use_on(), saw_stock_actor::can_use_on(), defense_game::caravan(), casings_handle(), npc::character_danger(), npc::check_or_use_weapon_cbm(), color_in_inventory(), npc::confident_shoot_range(), contents_info(), contextualize_skill(), damage_melee(), display_name(), durability_indicator(), final_info(), character_funcs::find_ammo_helper(), character_funcs::find_reloadables(), fire(), ranged::fire_gun(), avatar_action::fire_wielded_weapon(), character_funcs::fmt_wielded_weapon(), npc::form_opinion(), ranged::get_aim_types(), get_covered_body_parts(), get_encumber_when_containing(), get_free_mod_locations(), ranged::get_most_accurate_sight(), get_reload_time(), give_item_to(), gun_all_modes(), gun_cycle_mode(), gun_damage(), gun_dispersion(), gun_get_mode(), gun_get_mode_id(), gun_noise(), gun_range(), gun_recoil(), gun_set_mode(), gun_skill(), gun_type(), gunmod_info(), game::handle_action(), ranged::handle_gun_damage(), has_flag(), Character::i_add(), ideal_ranged_dps(), info(), character_effects::intimidation(), is_firearm(), is_gunmod_compatible(), is_reloadable(), gunmod_inventory_preset::is_shown(), saw_barrel_inventory_preset::is_shown(), saw_stock_inventory_preset::is_shown(), vehicle_part::is_turret(), Character::item_reload_cost(), Character::item_store_cost(), magazine_compatible(), magazine_default(), magazine_integral(), Item_modifier::modify(), item_reload_option::moves(), Character::on_dodge(), on_wield(), parse_tags(), tutorial_game::post_action(), Character::power_rating(), reach_range(), activity_handlers::reload_finish(), remove_ammo(), item_funcs::shots_remaining(), sight_dispersion(), starting_inv(), tname(), game::try_get_right_click_action(), character_funcs::try_wield_contents(), npc::value(), visit_internal(), volume(), weapon_inventory_preset::weapon_inventory_preset(), weight(), and npc::wield_better_weapon().
| bool item::is_gunmod | ( | ) | const |
Definition at line 6547 of file item.cpp.
References itype::gunmod, and type.
Referenced by allow_crafting_component(), combat_info(), final_info(), avatar_action::fire_wielded_weapon(), gun_all_modes(), gun_cycle_mode(), gun_get_mode_id(), gun_set_mode(), iuse::gunmod_attach(), gunmod_info(), game::handle_action(), info(), is_gunmod_compatible(), gunmod_inventory_preset::is_shown(), is_toolmod(), on_wield(), examine_item_menu::rate_action_use(), and reach_range().
Definition at line 7764 of file item.cpp.
References _, ammo_remaining(), ammo_types(), count(), debugmsg, flag_NEVER_JAMS(), flag_PUMP_ACTION(), flag_PUMP_RAIL_COMPATIBLE(), flag_RELOAD_EJECT(), flag_WATERPROOF_GUN(), get_free_mod_locations(), get_mod_locations(), gun_skill(), gun_type(), gunmod_find(), has_flag(), is_gun(), is_gunmod(), itype_brass_catcher, itype_hand_crossbow, itype_tuned_mechanism, itype_waterproof_gunmod, magazine_current(), ret_val< T >::make_failure(), ret_val< T >::make_success(), gunmod_location::name(), skill_archery, translate_marker_context, and typeId().
Referenced by gunmod_inventory_preset::get_denial(), avatar_funcs::gunmod_add(), and activity_handlers::gunmod_add_finish().
| bool item::is_holster | ( | ) | const |
Definition at line 6577 of file item.cpp.
References itype::can_use(), and type.
Referenced by character_funcs::find_reloadables(), and get_total_capacity().
| bool item::is_irremovable | ( | ) | const |
Definition at line 6775 of file item.cpp.
References flag_IRREMOVABLE(), and has_flag().
Referenced by allow_crafting_component(), detach_gunmods_actor::can_use(), remove_ammo(), and detach_gunmods_actor::use().
| bool item::is_magazine | ( | ) | const |
Definition at line 6557 of file item.cpp.
References itype::magazine, and type.
Referenced by allow_crafting_component(), ammo_capacity(), ammo_consume(), ammo_data(), ammo_default(), ammo_remaining(), ammo_set(), ammo_sort_name(), ammo_types(), ammo_unset(), color_in_inventory(), crafting::complete_disassemble(), display_name(), character_funcs::find_ammo_helper(), get_reload_time(), is_ammo_belt(), is_ammo_container(), vehicle_part::is_battery(), vehicle_part::is_fuel_store(), is_reloadable(), Character::item_reload_cost(), magazine_current(), magazine_info(), Item_modifier::modify(), iuse::multicooker(), avatar_action::reload(), reload(), character_funcs::select_ammo(), tname(), avatar_funcs::unload_item(), visit_internal(), wants_to_reload(), wants_to_reload_with(), weight(), and will_explode_in_fire().
| bool item::is_map | ( | ) | const |
Definition at line 6714 of file item.cpp.
References get_category(), item_category::get_id(), and itemcat_maps.
Referenced by map::add_item(), and display_name().
| bool item::is_med_container | ( | ) | const |
Definition at line 6615 of file item.cpp.
References contents, item_contents::empty(), item_contents::front(), and is_medication().
Referenced by info().
| bool item::is_medication | ( | ) | const |
Definition at line 6598 of file item.cpp.
References get_comestible(), and is_comestible().
Referenced by basic_info(), Character::can_eat(), Character::consume_charges(), Character::consume_med(), game_menus::inv::consume_meds(), comestible_inventory_preset::get_denial(), activatable_inventory_preset::get_denial(), npc::heal_self(), info(), Character::invoke_item(), is_med_container(), examine_item_menu::rate_action_use(), try_consume(), and avatar_funcs::use_item().
| bool item::is_melee | ( | ) | const |
Is this item an effective melee weapon for any damage type?
Definition at line 6667 of file item.cpp.
References DT_NULL, is_melee(), and NUM_DT.
Referenced by contextualize_skill(), is_melee(), melee_skill(), and on_wield().
| bool item::is_melee | ( | damage_type | dt | ) | const |
Is this item an effective melee weapon for the given damage type?
Definition at line 6677 of file item.cpp.
References damage_melee(), and MELEE_STAT.
Referenced by iexamine::cvdmachine(), Character::i_add(), tutorial_game::post_action(), and npc::wield_better_weapon().
| bool item::is_money | ( | ) | const |
Definition at line 6000 of file item.cpp.
References ammo_types().
Referenced by ammo_set(), display_name(), inventory_selector_preset::get_caption(), selection_column_preset::get_caption(), operator<(), and stacks_with().
| bool item::is_non_resealable_container | ( | ) | const |
Whether removing this item's contents will permanently alter it.
Definition at line 6729 of file item.cpp.
References itype::container, and type.
Referenced by deserialize(), advanced_inventory::move_content(), and on_contents_changed().
| bool item::is_null | ( | ) | const |
Definition at line 732 of file item.cpp.
References is_null(), nullitem(), type, and typeId().
Referenced by acid_resist(), npc::address_needs(), ammo_set(), base_volume(), bash_resist(), Character::block_hit(), Character::block_ranged_hit(), bullet_resist(), Character::can_eat(), vehicle_part::can_reload(), repair_item_actor::can_repair_target(), Character::can_use(), debug_menu::character_edit_menu(), color(), colorized_feature_description_at(), veh_interact::complete_vehicle(), conductive(), Character::consume_item(), cut_resist(), damage_melee(), display_name(), anonymous_namespace{iexamine.cpp}::atm_menu::do_transfer_all_money(), anonymous_namespace{iexamine.cpp}::atm_menu::do_withdraw_money(), drop_or_embed_projectile(), enumerate_objects_around_point(), Character::extended_description(), final_info(), find_auto_consume(), fire_resist(), inventory::form_from_map(), iexamine::gaspump(), liquid_handler::get_liquid_target(), SkillLevelMap::get_skill_level(), aim_activity_actor::get_weapon(), Character::handle_melee_wear(), npc::has_healing_item(), npc::heal_player(), npc::heal_self(), Character::i_add_or_drop(), info(), npc_trading::init_buying(), Character::is_armed(), is_null(), is_old_owner(), is_owned_by(), is_salvageable(), is_unarmed_weapon(), Character::item_encumb(), Character::item_reload_cost(), npc::load(), made_of(), Character::meets_requirements(), Character::melee_attack(), melee_train(), Item_modifier::modify(), explosion_handler::ExplosionProcess::move_entity(), item_location::impl::item_on_map::obtain(), item_location::impl::item_on_person::obtain(), item_location::impl::item_on_vehicle::obtain(), item_location::impl::item_in_container::obtain(), item_location::impl::item_on_map::obtain_cost(), item_location::impl::item_on_person::obtain_cost(), item_location::impl::item_on_vehicle::obtain_cost(), monexamine::pet_menu(), photo_def_for_camera_point(), rcdrive(), player::reduce_charges(), reinforceable(), bandolier_actor::reload(), reload(), Character::roll_bash_damage(), Character::roll_cut_damage(), Character::roll_stab_damage(), projectile::set_drop(), set_snippet(), npc::shop_restock(), map::spawn_items(), starting_inv(), Character::store(), npc::store(), holster_actor::store(), Character::suffer_from_schizophrenia(), Character::throw_range(), tname(), salvage_actor::try_to_cut_up(), Character::unarmed_attack(), Character::unwield(), avatar_funcs::use_item(), npc::use_painkiller(), salvage_actor::valid_to_cut_up(), volume(), martialart::weapon_valid(), Character::wear_possessed(), weight(), npc::wield(), avatar::wield(), and npc::wield_better_weapon().
| bool item::is_old_owner | ( | const Character & | c, |
| bool | available_to_take = false |
||
| ) | const |
| bool item::is_owned_by | ( | const Character & | c, |
| bool | available_to_take = false |
||
| ) | const |
Definition at line 1234 of file item.cpp.
References c, debugmsg, get_owner(), and is_null().
Referenced by activity_on_turn_move_loot(), move_items_activity_actor::do_turn(), find_auto_consume(), handle_pickup_ownership(), npc_trading::init_buying(), pick_one_up(), pickup::pick_up(), query_consume_ownership(), and npc::wants_to_sell().
| bool item::is_pet_armor | ( | bool | on_pet = false | ) | const |
Definition at line 6698 of file item.cpp.
References flag_IS_PET_ARMOR(), get_var(), and has_flag().
Referenced by animal_armor_info(), armor_protection_info(), get_base_env_resist(), get_base_env_resist_w_filter(), get_env_resist(), get_pet_armor_bodytype(), get_pet_armor_max_vol(), get_pet_armor_min_vol(), get_storage(), and get_thickness().
| bool item::is_power_armor | ( | ) | const |
Whether this is a power armor item.
Not necessarily the main armor, it could be a helmet or similar.
Definition at line 5786 of file item.cpp.
References flag_POWERARMOR_EXO(), flag_POWERARMOR_EXTERNAL(), flag_POWERARMOR_MOD(), and has_flag().
Referenced by armor_fit_info(), Character::can_wear(), Character::consume_charges(), final_info(), Character::has_enough_charges(), process_tool(), units_remaining(), and set_transform_iuse::use().
| bool item::is_relic | ( | ) | const |
Definition at line 6973 of file item.cpp.
References relic_data.
Referenced by get_enchantments(), mutations_from_wearing(), process_relic(), and stacks_with().
| bool item::is_reloadable | ( | ) | const |
Is it ever possible to reload this item? Only the base item is considered with any mods ignored.
Definition at line 9830 of file item.cpp.
References ammo_types(), flag_NO_RELOAD(), flag_VEHICLE(), has_flag(), is_bandolier(), is_container(), is_gun(), is_magazine(), and is_tool().
Referenced by can_reload_item_or_mods(), is_reloadable_helper(), and examine_item_menu::rate_action_reload().
|
private |
Helper for checking reloadability.
Definition at line 6876 of file item.cpp.
References itype::ammo, ammo_capacity(), ammo_current(), ammo_data(), ammo_remaining(), ammo_types(), contents, count(), item_contents::front(), is_container_empty(), is_container_full(), string_id< T >::is_empty(), is_reloadable(), is_watertight_container(), LIQUID, magazine_compatible(), magazine_integral(), itype::phase, and typeId().
Referenced by can_reload_with(), and is_reloadable_with().
| bool item::is_reloadable_with | ( | const itype_id & | ammo | ) | const |
Returns true if this item can be reloaded with specified ammo type at this moment.
Definition at line 6871 of file item.cpp.
References is_reloadable_helper().
Referenced by Character::can_reload(), vehicle_part::can_reload(), fill_with(), get_remaining_capacity_for_liquid(), and reload().
| bool item::is_salvageable | ( | ) | const |
Definition at line 6909 of file item.cpp.
References flag_NO_SALVAGE(), has_flag(), is_null(), and made_of().
Referenced by salvage_actor::try_to_cut_up(), and salvage_actor::valid_to_cut_up().
| bool item::is_seed | ( | ) | const |
Whether this is actually a seed, the seed functions won't be of much use for non-seeds.
Definition at line 9774 of file item.cpp.
References itype::seed, and type.
Referenced by can_do_activity_there(), iexamine::dirtmound(), farm_valid_seed(), talk_function::field_plant(), plot_options::get_zone_name_suggestion(), plot_options::query_seed(), vehicle::reload_seeds(), and map::rotten_item_spawn().
| bool item::is_sided | ( | ) | const |
Returns true if item is armor and can be worn on different sides of the body.
Definition at line 802 of file item.cpp.
References find_armor_data(), and islot_armor::sided.
Referenced by armor_fit_info(), armor_info(), Character::can_wear(), on_takeoff(), on_wear(), examine_item_menu::rate_action_change_side(), and set_side().
| bool item::is_silent | ( | ) | const |
Whether this is a (nearly) silent gun (a tiny bit of sound is allowed).
Non-guns are always silent.
Definition at line 6542 of file item.cpp.
References gun_noise(), and item::sound_data::volume.
Referenced by npc::check_or_use_weapon_cbm(), and npc::method_of_attack().
| bool item::is_soft | ( | ) | const |
Is this item flexible enough to be worn on body parts like antlers?
Definition at line 9822 of file item.cpp.
References made_of().
Referenced by mutation_branch::conflicts_with_item(), and game_menus::inv::multiwash().
| bool item::is_tainted | ( | ) | const |
Is item derived from a zombie?
Definition at line 9817 of file item.cpp.
References corpse, mtype::has_flag(), and MF_POISON.
Referenced by food_info().
| bool item::is_tool | ( | ) | const |
Definition at line 6958 of file item.cpp.
References itype::tool, and type.
Referenced by npc::activate_item(), ammo_capacity(), ammo_consume(), ammo_remaining(), ammo_required(), ammo_set(), ammo_sort_name(), ammo_types(), ammo_unset(), iuse::artifact(), charges_of_internal(), Character::consume_charges(), deactivate(), final_info(), character_funcs::find_ammo_helper(), heal_actor::finish_using(), get_quality(), getlight_emit(), Character::has_enough_charges(), Character::has_item_with_flag(), Character::i_add(), Character::invoke_item(), is_reloadable(), Item_modifier::modify(), item_reload_option::moves(), tutorial_game::post_action(), price(), game::process_artifact(), process_internal(), relic_funcs::process_recharge(), process_wet(), examine_item_menu::rate_action_use(), remove_ammo(), tname(), tool_info(), iuse::toolmod_attach(), toolmods(), avatar_funcs::unload_item(), use_charges(), avatar_funcs::use_item(), and npc::value().
| bool item::is_toolmod | ( | ) | const |
Definition at line 6765 of file item.cpp.
References is_gunmod(), itype::mod, and type.
Referenced by allow_crafting_component(), item_action_generator::map_actions_to_items(), iuse::multicooker(), and iuse::toolmod_attach().
| bool item::is_transformable | ( | ) | const |
Definition at line 6963 of file item.cpp.
References type, and itype::use_methods.
Referenced by map::add_item().
| bool item::is_two_handed | ( | const Character & | guy | ) | const |
Whether the character needs both hands to wield this item.
Strength determines which weapons can be wielded with one handDefinition at line 6404 of file item.cpp.
References flag_ALWAYS_TWOHAND(), has_flag(), Character::str_cur, and weight().
Referenced by Character::can_wear(), Character::can_wield(), ranged::gunmode_checks_common(), hardcoded_mutation_attack(), Character::item_handling_cost(), and Character::melee_special_effects().
| bool item::is_unarmed_weapon | ( | ) | const |
Definition at line 738 of file item.cpp.
References flag_UNARMED_WEAPON(), has_flag(), and is_null().
Referenced by Character::crit_chance(), melee_train(), Character::roll_bash_damage(), Character::roll_cut_damage(), and Character::roll_stab_damage().
| bool item::is_upgrade | ( | ) | const |
Whether the CBM is an upgrade to another bionic module.
Definition at line 10036 of file item.cpp.
References itype::bionic, and type.
Referenced by bionic_install_preset::get_denial(), and bionic_install_surgeon_preset::get_denial().
| bool item::is_watertight_container | ( | ) | const |
Whether this is a container which can be used to store liquids.
Definition at line 6724 of file item.cpp.
References itype::container, and type.
Referenced by advanced_inv_area::canputitems(), Character::consume(), is_container_eligible_for_crafting(), is_funnel_container(), is_reloadable_helper(), vehicle_part::is_tank(), item_reload_option::qty(), avatar_action::reload(), reload(), activity_handlers::reload_finish(), character_funcs::select_ammo(), and iexamine::tree_maple_tapped().
| bool item::is_wheel | ( | ) | const |
Definition at line 6755 of file item.cpp.
References type, and itype::wheel.
Referenced by can_do_activity_there(), tname(), wheel_area(), vehicle_part::wheel_diameter(), and vehicle_part::wheel_width().
| bool item::is_worn_only_with | ( | const item & | it | ) | const |
Returns true whether this item can be worn only when.
| it | is worn. |
Definition at line 835 of file item.cpp.
References flag_POWERARMOR_EXO(), flag_POWERARMOR_EXTERNAL(), flag_POWERARMOR_MOD(), and has_flag().
Referenced by Character::get_dependent_worn_items(), and pickup::reorder_for_dropping().
| bool item::item_has_uses_recursive | ( | ) | const |
Definition at line 80 of file item_action.cpp.
References contents, item_contents::item_has_uses_recursive(), type, and itype::use_methods.
| std::string item::label | ( | unsigned int | quantity = 0 | ) | const |
Returns label from "item_label" itemvar and quantity.
Definition at line 9952 of file item.cpp.
References get_var(), has_label(), and type_name().
Referenced by tname().
| void item::legacy_fast_forward_time | ( | ) |
Definition at line 10015 of file item.cpp.
References bday, last_rot_check, and calendar::turn_zero.
Referenced by deserialize(), and submap::load().
| int item::lift_strength | ( | ) | const |
Required strength to be able to successfully lift the item unaided by equipment.
Definition at line 5175 of file item.cpp.
References units::to_gram(), and weight().
Referenced by can_do_activity_there(), veh_interact::can_remove_part(), and veh_interact::update_part_requirements().
| const std::vector< material_id > & item::made_of | ( | ) | const |
The ids of all the materials this is made of.
This may return an empty vector. The returned vector does not contain the null id.
Definition at line 6413 of file item.cpp.
References corpse, is_corpse(), mtype::mat, itype::materials, and type.
Referenced by activity_on_turn_move_loot(), map::add_item(), map::add_item_or_charges(), avatar_funcs::add_or_drop_with_msg(), iuse::blech(), iuse::blech_because_unclean(), vehicle_part::can_reload(), can_unload_liquid(), saw_stock_actor::can_use_on(), Character::can_wear(), Character::can_wield(), MonsterGenerator::check_monster_definitions(), color_in_inventory(), crafting::complete_disassemble(), compute_default_effective_vitamins(), contents_made_of(), map::create_burnproducts(), auto_pickup::rule_list::create_rule(), salvage_actor::cut_up(), iexamine::cvdmachine(), move_items_activity_actor::do_turn(), Character::drop_invalid_inventory(), drop_or_handle(), final_info(), character_funcs::find_ammo_helper(), iexamine::fvat_empty(), iexamine::fvat_full(), Character::get_acquirable_energy(), get_base_material(), pickup_inventory_preset::get_denial(), comestible_inventory_preset::get_denial(), liquid_handler::get_liquid_target(), get_random_material(), repair_item_actor::handle_components(), liquid_handler::handle_liquid(), Character::i_add_or_drop(), in_container(), is_salvageable(), is_soft(), inscribe_actor::item_inscription(), iexamine::keg(), made_of(), made_of_any(), made_of_types(), Character::melee_special_effects(), Item_modifier::modify(), advanced_inventory::move_all_items(), advanced_inventory::move_content(), move_item(), iuse::multicooker(), npc_pickup_from_stack(), on_drop(), only_made_of(), liquid_handler::perform_liquid_transfer(), pick_one_up(), price(), monster::process_turn(), mattack::pull_metal_weapon(), item_reload_option::qty(), advanced_inventory::query_charges(), reload(), simulate_burn(), smash(), map::spawn_an_item(), starting_inv(), ranged::throw_item(), tname(), try_fuel_fire(), avatar_funcs::unload_item(), npc::value(), volume(), and Character::warmth().
| bool item::made_of | ( | const material_id & | mat_ident | ) | const |
Check we are made of this material (e.g.
matches at least one in our set.)
Definition at line 6459 of file item.cpp.
References detail::find(), and made_of().
| bool item::made_of | ( | phase_id | phase | ) | const |
| bool item::made_of_any | ( | const std::set< material_id > & | mat_idents | ) | const |
Check we are made of at least one of a set (e.g.
true if at least one item of the passed in set matches any material).
| mat_idents | Set of material ids. |
Definition at line 6435 of file item.cpp.
References made_of().
Referenced by Character::can_eat(), goes_bad(), repair_inventory_preset::is_shown(), inscribe_actor::item_inscription(), ranged::throw_item(), and Character::throw_range().
| std::vector< const material_type * > item::made_of_types | ( | ) | const |
Same as made_of(), but returns the material_type directly.
Definition at line 6426 of file item.cpp.
References made_of().
Referenced by acid_resist(), bash_resist(), basic_info(), bullet_resist(), chip_resistance(), conductive(), cut_resist(), fire_resist(), flammable(), reinforceable(), and wind_resist().
| std::set< itype_id > item::magazine_compatible | ( | bool | conversion = true | ) | const |
Get compatible magazines (if any) for this item.
| conversion | whether to include the effect of any flags or mods which convert item's ammo type |
Definition at line 7701 of file item.cpp.
References ammo_types(), gunmods(), is_gun(), itype::magazines, toolmods(), and type.
Referenced by mdeath::broken(), color_in_inventory(), character_funcs::find_reloadables(), gun_info(), avatar_funcs::gunmod_add(), is_reloadable_helper(), and tool_info().
| item * item::magazine_current | ( | ) |
Currently loaded magazine (if any)
Definition at line 7727 of file item.cpp.
References contents, item_contents::get_item_with(), and is_magazine().
Referenced by ammo_capacity(), ammo_consume(), ammo_data(), ammo_remaining(), ammo_set(), ammo_unset(), item_funcs::can_be_unloaded(), turret_data::can_unload(), common_ammo_default(), cycle_action(), iuse::foodperson(), iuse::hand_crank(), is_gunmod_compatible(), character_funcs::list_ammo(), magazine_current(), Item_modifier::modify(), reload(), character_funcs::select_ammo(), tool_info(), iuse::toolmod_attach(), avatar_funcs::unload_item(), volume(), and weight().
| const item * item::magazine_current | ( | ) | const |
Definition at line 7735 of file item.cpp.
References magazine_current().
| itype_id item::magazine_default | ( | bool | conversion = true | ) | const |
Get the default magazine type (if any) for the current effective ammo type.
| conversion | whether to include the effect of any flags or mods which convert item's ammo type |
Definition at line 7680 of file item.cpp.
References ammo_types(), gunmods(), is_gun(), itype::magazine_default, itype::mod, string_id< itype >::NULL_ID(), toolmods(), and type.
Referenced by ammo_capacity(), ammo_set(), defense_game::caravan(), game::dump_stats(), and Item_modifier::modify().
| void item::magazine_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 1881 of file item.cpp.
References _, ammo_capacity(), ammo_types(), flag_NO_RELOAD(), has_flag(), info(), insert_separation_line(), is_magazine(), iteminfo::lower_is_better, itype::magazine, MAGAZINE_CAPACITY, MAGAZINE_RELOAD, iteminfo::no_flags, string_format(), iteminfo_query::test(), type, and vgettext().
Referenced by info().
| bool item::magazine_integral | ( | ) | const |
Does item have an integral magazine (as opposed to allowing detachable magazines)
Definition at line 7665 of file item.cpp.
References itype::gun, gunmods(), is_gun(), itype::magazines, toolmods(), and type.
Referenced by character_funcs::ammo_count_for(), ammo_set(), ammo_unset(), turret_data::can_reload(), defense_game::caravan(), color_in_inventory(), game::dump_stats(), character_funcs::fmt_wielded_weapon(), gun_info(), avatar_funcs::gunmod_add(), ideal_ranged_dps(), is_reloadable_helper(), item(), Item_modifier::modify(), price(), reload(), character_funcs::select_ammo(), tool_info(), wants_to_reload_with(), and weight().
| uint64_t item::make_component_hash | ( | ) | const |
Creates a hash from the itype_ids of this item's components.
Definition at line 8918 of file item.cpp.
References components, base_camps::id, and string_id< T >::str().
Referenced by consumption_event::consumption_event(), and Character::fun_for().
|
static |
Make a corpse of the given monster type.
The monster type id must be valid (see MonsterGenerator::get_all_mtypes).
The turn parameter sets the birthday of the corpse, in other words: the turn when the monster died. Because corpses are removed from the map when they reach a certain age, one has to be careful when placing corpses with a birthday of 0. They might be removed immediately when the map is loaded without been seen by the player.
The name parameter can be used to give the corpse item a name. This is used instead of the monster type name ("corpse of X" instead of "corpse of bear").
With the default parameters it makes a human corpse, created at the current turn.
Definition at line 507 of file item.cpp.
References debugmsg, string_id< T >::is_valid(), MF_REVIVES, om_direction::name(), string_id< mtype >::NULL_ID(), string_id< T >::obj(), one_in(), to_string(), and calendar::turn.
Referenced by map::add_corpse(), game::catch_a_monster(), Single_item_creator::create_single(), map::draw_mine(), iuse::fish_trap(), basecamp::hunting_results(), make_mon_corpse(), MapExtras::mx_grave(), MapExtras::mx_mayhem(), MapExtras::mx_minefield(), Character::place_corpse(), rod_fish(), and mdeath::splatter().
| void item::mark_as_used_by_player | ( | const player & | p | ) |
Marks the item as being used by this specific player, it remains unmarked for other players.
The player is identified by its id.
Definition at line 8866 of file item.cpp.
References character_id::get_value(), Character::getID(), item_vars, string_format(), and USED_BY_IDS().
Referenced by reveal_map_actor::use().
| void item::mark_chapter_as_read | ( | const Character & | ch | ) |
Mark one chapter of the book as read by the given player.
May do nothing if the book has no unread chapters. This is a per-character setting, see get_remaining_chapters.
Definition at line 7103 of file item.cpp.
References itype::book, erase_var(), get_remaining_chapters(), character_id::get_value(), Character::getID(), set_var(), string_format(), and type.
Referenced by avatar::do_read(), and npc::finish_read().
| int item::max_damage | ( | ) | const |
Maximum amount of damage to an item (state before destroyed)
Definition at line 6216 of file item.cpp.
References itype::damage_max(), and type.
Referenced by mdeath::broken(), can_revive(), damage_color(), damage_level(), vehicle_part::damage_percent(), damage_symbol(), veh_interact::do_repair(), get_relative_health(), vehicle_part::health_percent(), vehicle_part::hp(), monster::init_from_item(), io(), vehicle_part::is_broken(), activity_handlers::make_zlave_finish(), vehicle_part::max_damage(), mod_damage(), vehicle::mod_hp(), on_damage(), vehicle::operate_scoop(), process_blackpowder_fouling(), process_corpse(), repair_item_actor::repair_chance(), set_damage(), vehicle::set_hp(), and Character::suffer_from_schizophrenia().
| void item::med_info | ( | const item * | med_item, |
| std::vector< iteminfo > & | info, | ||
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 1641 of file item.cpp.
References _, charges, DESCRIPTION_MED_ADDICTING, get_avatar(), get_comestible(), get_comestible_fun(), info(), MED_JOY, MED_PORTIONS, MED_QUENCH, MED_STIMULATION, om_direction::name(), string_format(), and iteminfo_query::test().
Referenced by info().
| skill_id item::melee_skill | ( | ) | const |
The most relevant skill used with this melee weapon.
Can be "null" if this is not a weapon. Note this function returns null if the item is a gun for which you can use gun_skill() instead.
Definition at line 7208 of file item.cpp.
References damage_melee(), DT_NULL, flag_UNARMED_WEAPON(), has_flag(), is_melee(), string_id< Skill >::NULL_ID(), NUM_DT, skill_by_dt(), and skill_unarmed.
Referenced by contextualize_skill(), Character::crit_chance(), Character::get_hit_weapon(), Character::item_store_cost(), on_wield(), and character_funcs::try_wield_contents().
| bool item::merge_charges | ( | const item & | rhs | ) |
Merge charges of the other item into this item.
Definition at line 976 of file item.cpp.
References charges, count_by_charges(), INFINITE_CHARGES, item_counter, and stacks_with().
Referenced by vehicle::add_item().
| int item::min_damage | ( | ) | const |
Minimum amount of damage to an item (state of maximum repair)
Definition at line 6211 of file item.cpp.
References itype::damage_min(), and type.
Referenced by repair_item_actor::can_repair_target(), damage_color(), repair_item_actor::default_action(), iuse::gun_repair(), io(), mod_damage(), and set_damage().
| time_duration item::minimum_freshness_duration | ( | temperature_flag | temperature | ) | const |
Time that this item is guaranteed to stay fresh.
| temperature | Temperature flag used to cap the duration. |
Definition at line 5700 of file item.cpp.
References itype::comestible, time_duration::from_turns(), get_hourly_rotpoints_at_temp(), calendar::INDEFINITELY_LONG_DURATION, rot, temperature_flag_to_highest_temperature(), and type.
Referenced by food_info().
| void item::mitigate_damage | ( | damage_unit & | du | ) | const |
Assuming that specified du hit the armor, reduce du based on the item's resistance to the damage type.
This will never reduce du.amount below 0.
Definition at line 6363 of file item.cpp.
References damage_unit::amount, and resistances::get_effective_resist().
Referenced by Character::armor_absorb(), and character_funcs::is_bp_immune_to().
| void item::mod_charges | ( | int | mod | ) |
Modify the charges of this item, only use for items counted by charges! The item must have enough charges for this (>= quantity) and be counted by charges.
| mod | How many charges should be removed. |
Definition at line 9721 of file item.cpp.
References charges, count_by_charges(), debugmsg, has_infinite_charges(), INFINITE_CHARGES, and tname().
Referenced by throw_activity_actor::do_turn(), Character::eat(), fill_with(), player::reduce_charges(), and talk_effect_fun_t::set_u_buy_item().
| bool item::mod_damage | ( | int | qty | ) |
same as other mod_damage, but uses DT_NULL as damage type.
Definition at line 6248 of file item.cpp.
References DT_NULL, and mod_damage().
| bool item::mod_damage | ( | int | qty, |
| damage_type | dt | ||
| ) |
Apply damage to const itemrained by min_damage and max_damage.
| qty | maximum amount by which to adjust damage (negative permissible) |
| dt | type of damage which may be passed to on_damage callback |
Definition at line 6226 of file item.cpp.
References charges, count_by_charges(), damage_, itype::damage_scale, max_damage(), min_damage(), on_damage(), itype::stack_size, and type.
Referenced by Character::armor_absorb(), iuse::gun_repair(), inc_damage(), activity_handlers::make_zlave_finish(), mod_damage(), vehicle::mod_hp(), and repair_item_actor::repair().
| units::energy item::mod_energy | ( | const units::energy & | qty | ) |
Add or remove energy from a battery.
If adding the specified energy quantity would go over the battery's capacity fill the battery and ignore the remainder. If adding the specified energy quantity would reduce the battery's charge level below 0 do nothing and return how far below 0 it would have gone.
| qty | energy quantity to add (can be negative) |
Definition at line 572 of file item.cpp.
References itype::battery, debugmsg, energy, energy_remaining(), is_battery(), and type.
| void item::mod_last_rot_check | ( | time_duration | processing_duration | ) |
This is part of a workaround so that items don't rot away to nothing if the smoking rack is outside the reality bubble.
| processing_duration |
Definition at line 5721 of file item.cpp.
References debugmsg, has_own_flag(), last_rot_check, and tname().
|
inline |
Definition at line 9076 of file item.cpp.
References Character::get_mutations(), is_relic(), and relic_data.
Referenced by Character::on_item_takeoff(), and Character::on_item_wear().
| bool item::needs_processing | ( | ) | const |
Whether the item should be processed (by calling process).
Definition at line 8935 of file item.cpp.
References active, contents, item_contents::empty(), flag_ETHEREAL_ITEM(), flag_RADIO_ACTIVATION(), item_contents::front(), has_flag(), is_artifact(), is_container(), is_food(), and needs_processing().
Referenced by map::add_item(), vehicle::add_item(), submap::load(), map::make_active(), vehicle::make_active(), needs_processing(), liquid_handler::perform_liquid_transfer(), and Character::process_items().
|
static |
Returns the translated item name for the item with given id.
The name is in the proper plural form as specified by the quantity parameter. This is roughly equivalent to creating an item instance and calling tname, however this function does not include strings like "(fresh)".
Definition at line 9922 of file item.cpp.
Referenced by act_vehicle_unload_fuel(), ammo_info(), veh_interact::calc_overview(), camp_car_description(), crafting::can_disassemble(), Character::can_eat(), player::craft_consume_tools(), harvest_list::describe(), veh_interact::display_details(), draw_caravan_items(), spellcasting_callback::draw_spell_info(), farm_action(), activity_handlers::fertilize_plot_do_turn(), final_info(), iexamine::fvat_empty(), plot_options::get_descriptions(), iexamine::get_seed_entries(), plot_options::get_zone_name_suggestion(), repair_item_actor::handle_components(), ammobelt_actor::info(), iexamine::keg(), ma_style_callback::key(), lcmatch_any(), mill_load_food(), iuse::multicooker(), vpart_info::name(), comp_selection< CompType >::nname(), parse_tags(), peek_related_recipe(), activity_handlers::plant_seed_finish(), iexamine::portable_structure(), iexamine::pour_into_keg(), vehicle::print_fuel_indicator(), vehicle::print_part_list(), iexamine::quern_examine(), crafting::query_tool_selection(), avatar_action::reload(), activity_handlers::repair_item_finish(), recipe::result_name(), vehicle::select_engine(), player::select_item_component(), talk_effect_fun_t::set_u_sell_item(), character_funcs::siphon(), smoker_load_food(), iexamine::smoker_options(), vehicle::start_engine(), tname(), tool_comp::to_string(), iexamine::tree_maple(), iexamine::tree_maple_tapped(), try_consume(), unfold_vehicle_iuse::use(), consume_drug_iuse::use(), sew_advanced_actor::use(), and vehicle::use_washing_machine().
| void item::on_contents_changed | ( | ) |
Callback when contents of the item are affected in any way other than just processing.
Definition at line 4538 of file item.cpp.
References itype::container, convert(), encumbrance_update_, is_non_resealable_container(), and type.
Referenced by veh_interact::complete_vehicle(), Character::consume_item(), fill_with(), give_item_to(), liquid_handler::handle_liquid_from_container(), advanced_inventory::move_content(), reload(), spill_contents(), character_funcs::try_wield_contents(), avatar_funcs::unload_item(), and use_amount().
| void item::on_damage | ( | int | qty, |
| damage_type | dt | ||
| ) |
Callback immediately before an item is damaged.
| qty | maximum damage that will be applied (constrained by max_damage) |
| dt | type of damage (or DT_NULL) |
Definition at line 4547 of file item.cpp.
References damage_, flag_PULPED(), is_corpse(), max_damage(), and set_flag().
Referenced by mod_damage(), and set_damage().
| bool item::on_drop | ( | const tripoint & | pos | ) |
Invokes item type's itype::drop_action.
This function can change the item.
| pos | Where is the item being placed. Note: the item isn't there yet. |
Definition at line 9987 of file item.cpp.
References get_map(), and on_drop().
Referenced by map::add_item_or_charges(), and on_drop().
Invokes item type's itype::drop_action.
This function can change the item.
| pos | Where is the item being placed. Note: the item isn't there yet. |
| map | A map object associated with that position. |
Definition at line 9992 of file item.cpp.
References use_function::call(), itype::drop_action, Character::flag_encumbrance(), flag_LIQUIDCONT(), get_avatar(), map::has_flag(), has_own_flag(), LIQUID, made_of(), set_flag(), and type.
| void item::on_pickup | ( | Character & | p | ) |
Callback when a player starts carrying the item.
The item is already in the inventory and is called from there. This is not called when the item is added to the inventory from worn vector or weapon slot. The item is considered already carried.
Definition at line 4516 of file item.cpp.
References itype::artifact, contents, Character::flag_encumbrance(), g, get_avatar(), Character::getID(), handle_pickup_ownership(), is_bucket_nonempty(), Creature::is_fake(), character_id::is_valid(), Character::pos(), item_contents::spill_contents(), and type.
Referenced by Character::i_add().
| void item::on_takeoff | ( | Character & | p | ) |
Callback when a character takes off an item.
The item is still in the worn items vector but will be removed immediately after the function returns
Definition at line 4395 of file item.cpp.
References active, Creature::as_player(), BOTH, set_transformed_iuse::bypass(), itype::can_use(), debugmsg, use_function::get_actor_ptr(), get_use(), is_sided(), Character::on_item_takeoff(), Character::pos(), set_side(), and type.
Referenced by Character::absorb_hit(), Character::i_rem(), and starting_clothes().
| void item::on_wear | ( | Character & | p | ) |
Callback when a character starts wearing the item.
The item is already in the worn items vector and is called from there.
Definition at line 4297 of file item.cpp.
References _, active, add_msg(), all_body_parts, itype::artifact, Creature::as_player(), BOTH, set_transformed_iuse::bypass(), itype::can_use(), convert_bp(), covers(), debugmsg, set_transformed_iuse::dependencies, char_encumbrance_data::elems, flag_POWERARMOR_MOD(), flag_SPLINT(), g, use_function::get_actor_ptr(), get_avatar(), get_covered_body_parts(), Character::get_encumbrance(), get_side(), get_use(), handle_pickup_ownership(), has_flag(), Character::is_limb_broken(), is_sided(), LEFT, num_bp, Character::on_item_wear(), body_part_type::part_side, Character::pos(), set_transformed_iuse::restricted, RIGHT, set_side(), body_part_set::test(), iexamine::transform(), type, Character::worn, and Character::worn_with_flag().
Referenced by starting_clothes().
| void item::on_wield | ( | player & | p, |
| int | mv = 0 |
||
| ) |
Callback when a player starts wielding the item.
The item is already in the weapon slot and is called from there.
| p | player that has started wielding item |
| mv | number of moves already spent wielding the weapon |
Definition at line 4415 of file item.cpp.
References _, player::add_msg_if_player(), itype::artifact, Character::flag_encumbrance(), flag_NEEDS_UNFOLD(), flag_SLOW_WIELD(), g, get_avatar(), Character::get_skill_level(), get_var(), Character::getID(), gun_skill(), handle_pickup_ownership(), has_flag(), is_gun(), is_gunmod(), is_melee(), character_id::is_valid(), units::legacy_volume_factor, m_neutral, Character::martial_arts_data, melee_skill(), Creature::moves, tname(), type, and volume().
Referenced by character_funcs::try_wield_contents(), and avatar::wield().
| bool item::only_made_of | ( | const std::set< material_id > & | mat_idents | ) | const |
Check we are made of only the materials (e.g.
false if we have one material not in the set or no materials at all).
| mat_idents | Set of material ids. |
Definition at line 6447 of file item.cpp.
References made_of().
Referenced by salvage_actor::try_to_cut_up(), and salvage_actor::valid_to_cut_up().
| bool item::operator< | ( | const item & | other | ) | const |
Definition at line 7157 of file item.cpp.
References charges, contents, item_contents::empty(), item_contents::front(), get_category(), itype::get_id(), is_container(), is_money(), localized_compare, itype::nname(), other, and type.
| int item::price | ( | bool | practical | ) | const |
Returns the monetary value of an item.
If practical is false, returns pre-cataclysm market value, otherwise returns approximate post-cataclysm value.
Definition at line 4921 of file item.cpp.
References ammo_capacity(), ammo_data(), ammo_remaining(), ammo_types(), count_by_charges(), damage(), is_tool(), LIQUID, made_of(), magazine_integral(), NEXT, itype::price, itype::price_post, rotten(), units::to_cent(), type, and visitable< item >::visit_items().
Referenced by talk_function::bionic_install(), talk_function::bionic_remove(), defense_game::caravan(), draw_caravan_items(), talk_function::field_harvest(), final_info(), bionic_install_surgeon_preset::get_money_amount(), npc_trading::init_buying(), npc_trading::init_selling(), parse_tags(), talk_effect_fun_t::set_bulk_trade_accept(), npc::shop_restock(), npc::value(), npc::wants_to_buy(), and npc::wants_to_sell().
| bool item::process | ( | player * | carrier, |
| const tripoint & | pos, | ||
| bool | activate, | ||
| temperature_flag | flag, | ||
| const weather_manager & | weather_generator | ||
| ) |
Definition at line 9597 of file item.cpp.
References activate(), itype::container, last_rot_check, NEXT, process_internal(), visitable< item >::remove_item(), calendar::turn, type, and visitable< item >::visit_items().
| bool item::process | ( | player * | carrier, |
| const tripoint & | pos, | ||
| bool | activate, | ||
| temperature_flag | flag = temperature_flag::TEMP_NORMAL |
||
| ) |
This is called once each turn.
It's usually only useful for active items, but can be called for inactive items without problems. It is recursive, and calls process on any contained items.
| carrier | The player / npc that carries the item. This can be null when the item is not carried by anyone (laying on ground)! |
| pos | The location of the item on the map, same system as player::pos used. If the item is carried, it should be the location of the carrier. |
| activate | Whether the item should be activated (true), or processed as an active item. |
Definition at line 9591 of file item.cpp.
References activate(), get_weather(), and process().
Referenced by map::add_item(), iuse::cable_attach(), drop_or_embed_projectile(), mattack::kamikaze(), process(), vehicle_part::process_contents(), Character::process_items(), and iuse::tow_attach().
Process and apply artifact effects.
This should be called exactly once each turn, it may modify character stats (like speed, strength, ...), so call it after those have been reset.
| carrier | The character carrying the artifact, can be null. |
| pos | The location of the artifact (should be the player location if carried). |
Definition at line 9061 of file item.cpp.
References g, get_avatar(), and is_artifact().
Referenced by Character::process_turn().
|
protected |
Definition at line 9580 of file item.cpp.
References _, player::add_msg_if_player(), damage(), DT_ACID, inc_damage(), m_bad, max_damage(), one_in(), and tname().
Referenced by process_internal().
Definition at line 9362 of file item.cpp.
References _, player::add_msg_if_player(), charges, g, get_cable_target(), get_map(), get_var(), visitable< T >::has_item(), visitable< T >::has_item_with(), map::has_zlevels(), visitable< T >::items_with(), m_bad, itype::maximum_charges(), reset_cable(), rl_dist(), type, map::veh_at(), and Character::worn_with_flag().
Referenced by process_internal().
Definition at line 9119 of file item.cpp.
References _, add_msg(), player::add_msg_if_player(), burnt, corpse, damage(), g, get_avatar(), get_shelf_life(), mtype::in_species(), units::legacy_volume_factor, m_warning, max_damage(), ready_to_revive(), rng(), ROBOT, rotten(), volume(), and mtype::zombify_into.
Referenced by process_internal().
Definition at line 9267 of file item.cpp.
References _, active, player::add_msg_if_player(), convert(), flag_DEEP_WATER(), flag_LIQUID(), flag_LITCIG(), flag_RAIN_PROTECT(), flag_WIND_EXTINGUISH(), g, get_avatar(), get_map(), get_weather(), has_flag(), map::has_flag(), visitable< T >::has_item(), heavy, Character::in_vehicle, itype::invoke(), itype_cig_butt, itype_cig_lit, itype_cigar_butt, itype_cigar_lit, itype_joint_roach, light, m_neutral, one_in(), Character::primary_weapon(), tname(), itype::tool, type, typeId(), map::veh_at(), very_light, and weather_manager::windspeed.
Referenced by process_internal(), and process_litcig().
Definition at line 9158 of file item.cpp.
References age(), birthday(), map::furn(), get_avatar(), get_map(), item_counter, and iexamine::mill_finalize().
Referenced by process_internal().
Definition at line 9175 of file item.cpp.
References age(), birthday(), map::furn(), get_map(), item_counter, and iexamine::on_smoke_out().
Referenced by process_internal().
|
private |
Definition at line 9625 of file item.cpp.
References _, activate(), active, player::add_msg_if_player(), use_function::call(), itype::countdown_action, itype::countdown_destroy, map::emit_field(), itype::emits, fault_gun_blackpowder, faults, flag_CABLE_SPOOL(), flag_ETHEREAL_ITEM(), flag_FAKE_MILL(), flag_FAKE_SMOKE(), flag_IS_UPS(), flag_LITCIG(), flag_WATER_EXTINGUISH(), flag_WET(), flag_WIND_EXTINGUISH(), get_avatar(), get_map(), get_var(), has_flag(), has_var(), itype::invoke(), is_comestible(), is_corpse(), is_food(), is_tool(), item_counter, process_blackpowder_fouling(), process_cable(), process_corpse(), process_extinguish(), process_fake_mill(), process_fake_smoke(), process_litcig(), process_rot(), process_tool(), process_UPS(), process_wet(), map::rotten_item_spawn(), set_var(), tname(), and type.
Referenced by process().
Definition at line 9192 of file item.cpp.
References _, active, Creature::add_effect(), map::add_field(), map::add_item_or_charges(), player::add_msg_if_player(), convert(), effect_cig, effect_shakes, effect_sleep, effect_weed_high, fd_fire, fd_weedsmoke, flag_FLAMMABLE(), flag_FLAMMABLE_ASH(), flag_TOBACCO(), map::flammable_items_at(), get_map(), Creature::has_effect(), has_flag(), map::has_flag(), Character::has_trait(), item_counter, itype_cig_butt, itype_cig_lit, itype_cigar_butt, itype_cigar_lit, itype_joint_roach, m_bad, m_neutral, Creature::moves, one_in(), process_extinguish(), rng(), tname(), trait_LIGHTWEIGHT, trait_TOLERANCE, typeId(), and weed_msg().
Referenced by process_internal().
| void item::process_relic | ( | Character & | carrier | ) |
Definition at line 9103 of file item.cpp.
References get_enchantments(), is_relic(), and relic_funcs::process_recharge().
Referenced by Character::process_turn().
| bool item::process_rot | ( | bool | seals, |
| const tripoint & | pos, | ||
| player * | carrier, | ||
| temperature_flag | flag, | ||
| const weather_manager & | weather_generator | ||
| ) |
Definition at line 8979 of file item.cpp.
References AVERAGE_ANNUAL_TEMPERATURE, calc_rot(), clip_by_temperature_flag(), calendar::config, units::from_fahrenheit(), g, get_map(), weather_generator::get_weather_temperature(), has_rotten_away(), last_rot_check, iuse::seed(), time, calendar::turn, and tripoint::z.
| bool item::process_rot | ( | const tripoint & | pos | ) |
Update temperature for things like food Update rot for things that perish All items that rot also have temperature.
| seals | Wether the item is in sealed container |
| pos | The current position |
| carrier | The current carrier |
| flag | to specify special temperature situations |
| weather_generator | weather manager, mostly for testing |
Definition at line 8951 of file item.cpp.
References get_weather(), process_rot(), and TEMP_NORMAL.
Referenced by actualize_rot(), process_internal(), and process_rot().
Definition at line 9466 of file item.cpp.
References _, active, player::add_msg_if_player(), ammo_consume(), ammo_required(), set_transformed_iuse::bypass(), character_funcs::can_interface_armor(), itype::can_use(), deactivate(), debugmsg, set_transformed_iuse::dependencies, energy, set_transform_iuse::flag, flag_USE_UPS(), use_function::get_actor_ptr(), get_avatar(), get_use(), has_flag(), itype::invoke(), is_power_armor(), itype_bio_armor, itype_UPS, m_info, set_transformed_iuse::restricted, itype::tick(), tname(), itype::tool, calendar::turn, type, Character::use_charges_if_avail(), Character::worn, and x_in_y().
Referenced by process_internal().
Definition at line 9435 of file item.cpp.
References active, erase_var(), flag_CABLE_SPOOL(), get_var(), has_flag(), and visitable< T >::has_item_with().
Referenced by process_internal().
Definition at line 9453 of file item.cpp.
References active, convert(), is_tool(), item_counter, itype::tool, type, and unset_flag().
Referenced by process_internal().
| int item::processing_speed | ( | ) | const |
The rate at which an item should be processed, in number of turns between updates.
Definition at line 8942 of file item.cpp.
References is_corpse(), is_food(), and is_food_container().
Referenced by active_item_cache::add(), and active_item_cache::remove().
| void item::put_in | ( | const item & | payload | ) |
Puts the given item into this one, no checks are performed.
Definition at line 995 of file item.cpp.
References contents, and item_contents::insert_item().
Referenced by add_rain_to_container(), ammo_set(), vehicle_part::ammo_set(), iuse::blood_draw(), defense_game::caravan(), cycle_action(), game::dump_stats(), fill_with(), avatar_funcs::gunmod_add(), activity_handlers::gunmod_add_finish(), item(), item_contents::migrate_item(), activity_handlers::mind_splicer_finish(), Item_modifier::modify(), iuse::multicooker(), iuse::radiocar(), bandolier_actor::reload(), reload(), talk_effect_fun_t::set_u_buy_item(), starting_inv(), character_funcs::store_in_container(), iuse_transform::use(), saw_barrel_actor::use(), and saw_stock_actor::use().
| void item::qualities_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3228 of file item.cpp.
References _, item_contents::all_items_top(), contents, convert_weight(), item_contents::has_any_with(), info(), insert_separation_line(), qual_JACK, qual_LIFT, QUALITIES, itype::qualities, QUALITIES_CONTAINED, sorted_lex(), string_format(), iteminfo_query::test(), TOOL_LIFT_FACTOR, type, and weight_units().
Referenced by info().
| const std::map< quality_id, int > & item::quality_of | ( | ) | const |
| int item::reach_range | ( | const Character & | guy | ) | const |
Max range of melee attack this weapon can be used for.
Accounts for character's abilities and installed gun mods. Guaranteed to be at least 1
Definition at line 5265 of file item.cpp.
References flag_REACH3(), flag_REACH_ATTACK(), gun_all_modes(), has_flag(), is_gun(), is_gunmod(), and Creature::is_npc().
Referenced by avatar_action::autoattack(), fire(), npc::invalidate_range_cache(), Character::melee_attack(), npc_ai::melee_value(), npc::method_of_attack(), and target_handler::mode_reach().
| bool item::ready_to_revive | ( | const tripoint & | pos | ) | const |
Whether this corpse should revive now.
Note that this function includes some randomness, the return value can differ on successive calls.
| pos | The location of the item (see REVIVE_SPECIAL flag). |
Definition at line 5965 of file item.cpp.
References age(), burnt, can_revive(), damage_level(), flag_REVIVE_SPECIAL(), get_map(), get_player_character(), has_flag(), calendar::once_every(), one_in(), rl_dist(), and volume().
Referenced by process_corpse().
| bool item::reinforceable | ( | ) | const |
Whether the item can be repaired beyond normal health.
Definition at line 6499 of file item.cpp.
References flag_NO_REPAIR(), has_flag(), is_null(), and made_of_types().
Referenced by repair_item_actor::can_repair_target(), repair_item_actor::repair(), and repair_info().
| bool item::release_monster | ( | const tripoint & | target, |
| int | radius = 0 |
||
| ) |
Definition at line 9236 of file iuse.cpp.
References _, debugmsg, deserialize(), erase_var(), g, and get_var().
Referenced by iuse::capture_monster_act(), and DefaultRemovePartHandler::spawn_animal_from_part().
| bool item::reload | ( | player & | u, |
| item_location | loc, | ||
| int | qty | ||
| ) |
Reload item using ammo from location returning true if successful.
| u | Player doing the reloading |
| loc | Location of ammo to be reloaded |
| qty | caps reloading to this (or fewer) units |
Definition at line 8111 of file item.cpp.
References item_contents::all_items_top(), ammo_capacity(), ammo_consume(), ammo_plutonium, ammo_remaining(), ammo_type(), casings_handle(), charges, contents, curammo, debugmsg, Character::dispose_item(), fill_with(), flag_SPEEDLOADER(), item_contents::front(), item_location::get_item(), get_remaining_capacity_for_liquid(), has_flag(), Character::i_add(), Character::i_add_or_drop(), Character::inv, is_ammo_belt(), is_ammo_container(), is_container(), is_magazine(), is_null(), is_reloadable_with(), is_watertight_container(), LIQUID, made_of(), itype::magazine, magazine_current(), magazine_integral(), on_contents_changed(), pgettext(), PLUTONIUM_CHARGES, pickup::prompt, put_in(), item_location::remove_item(), visitable< item >::remove_item(), visitable< T >::remove_item(), inventory::restack(), string_format(), tname(), tripoint_zero, type, typeId(), and Character::use_charges_if_avail().
Referenced by veh_interact::complete_vehicle(), npc::do_reload(), ranged::fire_gun(), and activity_handlers::reload_finish().
|
inline |
Definition at line 2026 of file item.h.
References string_id< faction >::NULL_ID().
Referenced by talk_function::drop_stolen_item(), and validate_ownership().
|
inline |
Definition at line 2033 of file item.h.
References string_id< faction >::NULL_ID().
Referenced by validate_ownership().
| void item::repair_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3153 of file item.cpp.
References _, DESCRIPTION_REPAIREDWITH, enumerate_as_string(), info(), insert_separation_line(), or_, reinforceable(), repaired_with(), sorted_lex(), string_format(), and iteminfo_query::test().
Referenced by info().
| const std::set< itype_id > & item::repaired_with | ( | ) | const |
If possible to repair this item what tools could potentially be used for this purpose?
Definition at line 6357 of file item.cpp.
References flag_NO_REPAIR(), has_flag(), itype::repair, and type.
Referenced by repair_info().
| void item::reset_cable | ( | player * | p | ) |
Helper to bring a cable back to its initial state.
Definition at line 9418 of file item.cpp.
References _, active, player::add_msg_if_player(), charges, erase_var(), m_info, itype::maximum_charges(), Creature::moves, set_var(), and type.
Referenced by process_cable().
|
inline |
returns true if item is now rotten after all shelf life has elapsed
Definition at line 850 of file item.h.
Referenced by veh_interact::calc_overview(), crafting::can_disassemble(), basecamp::distribute_food(), Character::eat(), food_info(), comestible_inventory_preset::get_freshness(), liquid_handler::get_liquid_target(), is_non_rotten_crafting_component(), mill_load_food(), Character::modify_morale(), price(), process_corpse(), smoker_load_food(), stacks_with(), tname(), and Character::will_eat().
| void item::serialize | ( | JsonOut & | json | ) | const |
Definition at line 2391 of file savegame_json.cpp.
References contents, item_contents::empty(), io(), and JsonOut::member().
Referenced by contain_monster().
| void item::set_age | ( | const time_duration & | age | ) |
Definition at line 10010 of file item.cpp.
References age(), set_birthday(), and calendar::turn.
Referenced by burn(), iuse::firecracker_pack(), iuse::fish_trap(), iexamine::fvat_empty(), vehicle::operate_planter(), and map::process_fields_in_submap().
| void item::set_birthday | ( | const time_point & | bday | ) |
Definition at line 10031 of file item.cpp.
References bday, and calendar::turn_zero.
Referenced by editmap::edit_itm(), retroactively_fill_from_funnel(), set_age(), and debug_menu::wishitem().
| void item::set_cached_tool_selections | ( | const std::vector< comp_selection< tool_comp > > & | selections | ) |
Definition at line 10112 of file item.cpp.
References craft_data_.
Referenced by craft_command::create_in_progress_craft().
| void item::set_countdown | ( | int | num_turns | ) |
Sets time until activation for an item that will self-activate in the future.
Definition at line 8603 of file item.cpp.
References ammo_types(), charges, and debugmsg.
Referenced by iuse_transform::use().
| item & item::set_damage | ( | int | qty | ) |
Filter setting damage constrained by min_damage and max_damage.
Definition at line 714 of file item.cpp.
References damage_, DT_TRUE, max_damage(), min_damage(), and on_damage().
Referenced by mdeath::broken(), editmap::edit_itm(), iuse::gun_repair(), Item_modifier::modify(), vehicle_part::properties_to_item(), repair_item_actor::repair(), game::save_cyborg(), vehicle::set_hp(), and map::spawn_an_item().
| void item::set_favorite | ( | bool | favorite | ) |
Definition at line 10084 of file item.cpp.
References is_favorite.
Referenced by advanced_inventory::display(), and inventory_column::set_stack_favorite().
| item & item::set_flag | ( | const std::string & | flag | ) |
Idempotent filter setting an item specific flag.
Definition at line 5332 of file item.cpp.
References cata::flat_set< T, Compare, Data >::insert(), and item_tags.
Referenced by map::add_corpse(), ammo_set(), are_requirements_nearby(), iexamine::autodoc(), explosion_handler::ExplosionProcess::blast_tile(), butcher_cbm_item(), activity_handlers::butcher_finish(), butchery_quarter(), iuse::camera(), crafting::complete_disassemble(), recipe::create_byproducts(), Single_item_creator::create_single(), cycle_action(), game::dump_stats(), heal_actor::finish_using(), basecamp::form_crafting_inventory(), inventory::form_from_map(), activity_handlers::repair_activity_hack::anonymous_namespace{activity_handlers.cpp}::get_fake_tool(), iuse_transform::info(), inherit_flags(), init_memory_card_with_random_stuff(), item(), Item_factory::migrate_item(), Item_modifier::modify(), explosion_handler::ExplosionProcess::move_entity(), iexamine::nanofab(), on_damage(), on_drop(), vehicle_part::properties_to_item(), iuse::radio_mod(), activity_handlers::reload_finish(), repair_item_actor::repair(), mattack::riotbot(), set_flag_recursive(), spell_effect::spawn_ethereal_item(), map::spawn_item(), starting_clothes(), starting_inv(), iuse::towel_common(), avatar_funcs::unload_item(), sew_advanced_actor::use(), unpack_actor::use(), iexamine::use_furn_fake_item(), and vehicle_part::vehicle_part().
| item & item::set_flag_recursive | ( | const std::string & | flag | ) |
Idempotent filter recursively setting an item specific flag on this item and its components.
Definition at line 5344 of file item.cpp.
References components, and set_flag().
| void item::set_mtype | ( | const mtype * | m | ) |
Sets the monster type associated with this item (corpse).
You must not pass a null pointer. TODO: change this to take a reference instead.
Definition at line 6652 of file item.cpp.
References corpse, debugmsg, and tname().
Referenced by iuse::blood_draw().
| void item::set_next_failure_point | ( | const player & | crafter | ) |
Calculates and sets the next failure point for an in progress craft.
Causes a debugmsg if called on non-craft.
| crafter | the crafting player |
Definition at line 904 of file crafting.cpp.
References craft_data_, player::crafting_success_roll(), debugmsg, get_making(), is_craft(), item_counter, and tname().
Referenced by craft_command::create_in_progress_craft(), and handle_craft_failure().
|
inline |
Definition at line 2023 of file item.h.
Referenced by handle_pickup_ownership().
| void item::set_owner | ( | const Character & | c | ) |
|
inline |
Definition at line 2029 of file item.h.
Referenced by activity_on_turn_move_loot(), complete_craft(), move_items_activity_actor::do_turn(), talk_function::drop_stolen_item(), talk_function::give_equipment(), handle_pickup_ownership(), npc::shop_restock(), starting_clothes(), starting_inv(), npc::starting_weapon(), and npc_trading::transfer_items().
| void item::set_relative_rot | ( | double | val | ) |
Set current item rot relative to shelf life (no-op if item does not spoil)
Definition at line 5539 of file item.cpp.
References flag_PROCESSING_RESULT(), get_shelf_life(), goes_bad(), has_flag(), last_rot_check, and calendar::turn.
Referenced by complete_craft(), fill_with(), item(), and iexamine::keg().
| void item::set_rot | ( | time_duration | val | ) |
| bool item::set_side | ( | side | s | ) |
Change the side on which the item is worn.
Returns false if the item is not sided
Definition at line 815 of file item.cpp.
References BOTH, erase_var(), is_sided(), and set_var().
Referenced by on_takeoff(), on_wear(), and swap_side().
| void item::set_snippet | ( | const snippet_id & | id | ) |
Set the snippet text (description) of this specific item, using the snippet library.
Definition at line 8679 of file item.cpp.
References debugmsg, base_camps::id, is_null(), and snip_id.
Referenced by profession::items().
| void item::set_tools_to_continue | ( | bool | value | ) |
Definition at line 10100 of file item.cpp.
References craft_data_.
Referenced by craft_command::create_in_progress_craft().
| void item::set_var | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
| void item::set_var | ( | const std::string & | name, |
| const tripoint & | value | ||
| ) |
Definition at line 1039 of file item.cpp.
References item_vars, om_direction::name(), string_format(), tripoint::x, tripoint::y, and tripoint::z.
| void item::set_var | ( | const std::string & | name, |
| double | value | ||
| ) |
Definition at line 1025 of file item.cpp.
References item_vars, om_direction::name(), and string_format().
| void item::set_var | ( | const std::string & | name, |
| int | value | ||
| ) |
Definition at line 1000 of file item.cpp.
References item_vars, and om_direction::name().
Referenced by monexamine::add_armor(), map::add_item(), iuse::cable_attach(), iuse::camera(), clear_faults(), contain_monster(), iuse::dive_tank(), iuse::ehandcuffs(), einkpc_download_memory_card(), iuse::einktabletpc(), fetch_activity(), vehicle::fold_up(), iuse::gasmask(), gun_set_mode(), ranged::handle_gun_damage(), init_memory_card_with_random_stuff(), item(), inscribe_actor::item_inscription(), item_save_monsters(), item_write_extended_photos(), activity_handlers::make_zlave_finish(), mark_chapter_as_read(), activity_handlers::mend_item_finish(), Item_modifier::modify(), move_item(), iuse::multicooker(), process_internal(), vehicle_part::properties_to_item(), activity_handlers::reload_finish(), reset_cable(), mattack::riotbot(), iuse::rpgdie(), mattack::searchlight(), select_crafting_recipe(), set_side(), spell_effect::spawn_ethereal_item(), iuse::tow_attach(), and update_clothing_mod_val().
| void item::set_var | ( | const std::string & | name, |
| long long | value | ||
| ) |
| void item::set_var | ( | const std::string & | name, |
| long | value | ||
| ) |
| int item::sight_dispersion | ( | ) | const |
Get lowest dispersion of either integral or any attached sights.
Definition at line 7261 of file item.cpp.
References flag_DISABLE_SIGHTS(), itype::gun, gunmods(), has_flag(), is_gun(), and type.
Referenced by ranged::get_aim_types(), target_ui::panel_recoil(), print_aim(), and target_ui::run().
| float item::simulate_burn | ( | fire_data & | frd | ) | const |
Calculate all burning calculations, but don't actually apply them to item.
DO apply them to fire_data argument, though.
Definition at line 8231 of file item.cpp.
References base_volume(), mat_burn_data::burn, fire_data::contained, count_by_charges(), fire_data::fire_intensity, mat_burn_data::fuel, fire_data::fuel_produced, mat_burn_data::immune, LIQUID, made_of(), rng(), mat_burn_data::smoke, fire_data::smoke_produced, itype::stack_size, units::to_liter(), type, and mat_burn_data::volume_per_turn.
Referenced by burn(), and try_fuel_fire().
| bool item::spill_contents | ( | Character & | c | ) |
Unloads the item's contents.
| c | Character who receives the contents. If c is the player, liquids will be handled, otherwise they will be spilled. |
Definition at line 7059 of file item.cpp.
References c, contents, item_contents::handle_liquid_or_spill(), is_container(), is_container_empty(), on_contents_changed(), and spill_contents().
Referenced by drop_or_embed_projectile(), pickup::handle_spillable_contents(), Character::i_rem_keep_contents(), pick_one_up(), smash(), and spill_contents().
| bool item::spill_contents | ( | const tripoint & | pos | ) |
Unloads the item's contents.
| pos | Position to dump the contents on. |
Definition at line 7075 of file item.cpp.
References map::add_item_or_charges(), item_contents::all_items_top(), item_contents::clear_items(), contents, get_map(), is_container(), and is_container_empty().
| item item::split | ( | int | qty | ) |
Splits a count-by-charges item always leaving source item with minimum of 1 charge.
| qty | number of required charges to split from source |
Definition at line 721 of file item.cpp.
References charges, count_by_charges(), and item().
Referenced by iexamine::gaspump(), Character::item_reload_cost(), item_location::impl::item_on_map::obtain(), item_location::impl::item_on_person::obtain(), item_location::impl::item_on_vehicle::obtain(), item_location::impl::item_in_container::obtain(), item_location::impl::item_on_map::obtain_cost(), item_location::impl::item_on_person::obtain_cost(), item_location::impl::item_on_vehicle::obtain_cost(), and bandolier_actor::reload().
| int item::spoilage_sort_order | ( | ) | const |
Get time left to rot, ignoring fridge.
Returns time to rot if item is able to, max int - N otherwise, where N is 3 for food, 2 for medication, 1 for other comestibles, 0 otherwise.
Definition at line 5557 of file item.cpp.
References itype::container, contents, item_contents::empty(), item_contents::front(), get_category(), get_comestible(), item_category::get_id(), get_shelf_life(), goes_bad(), itemcat_drugs, itemcat_food, rot, and type.
Referenced by find_auto_consume().
| int item::stab_resist | ( | bool | to_self = false | ) | const |
| bool item::stacks_with | ( | const item & | rhs, |
| bool | check_components = false, |
||
| bool | skip_type_check = false |
||
| ) | const |
Definition at line 889 of file item.cpp.
References active, ammo_current(), burnt, charges, clipped_time(), components, contents, corpse, count_by_charges(), craft_data_, damage_, faults, get_shelf_life(), get_uncraft_components(), goes_bad(), mtype::id, is_comestible(), is_craft(), is_favorite, is_money(), is_relic(), item_tags, item_vars, item_contents::num_item_stacks(), relic_data, rot, rotten(), item_contents::stacks_with(), techniques, and type.
Referenced by display_stacked_with(), merge_charges(), inventory::restack(), inventory_column::set_stack_favorite(), and npc_trading::transfer_items().
| bool item::swap_side | ( | ) |
Swap the side on which the item is worn.
Returns false if the item is not sided
Definition at line 830 of file item.cpp.
References get_side(), opposite_side(), and set_side().
Referenced by Character::change_side().
| const std::string & item::symbol | ( | ) | const |
Definition at line 4122 of file item.cpp.
References itype::sym, and type.
Referenced by map::draw_maptile(), map_memory::load_legacy(), mm_elem::operator==(), pickup::pick_up(), mm_submap::serialize(), and debug_menu::wishitem().
| std::string item::tname | ( | unsigned int | quantity = 1, |
| bool | with_prefix = true, |
||
| unsigned int | truncate = 0 |
||
| ) | const |
Return the (translated) item name.
| quantity | used for translation to the proper plural form of the name, e.g. returns "rock" for quantity 1 and "rocks" for quantity > 0. |
| with_prefix | determines whether to include more item properties, such as the extent of damage and burning (was created to sort by name without prefix in additional inventory) |
Definition at line 4554 of file item.cpp.
References _, active, already_used_by_player(), big_sized_small_char, burnt, charges, contents, craft_data_, damage(), debugmsg, durability_indicator(), item_contents::empty(), engine_displacement(), fault_bionic_nonsterile, faults, flag_CBM_SCANNED(), flag_DIAMOND(), flag_ETHEREAL_ITEM(), flag_FIT(), flag_HEATS_FOOD(), flag_HIDDEN_HALLU(), flag_HIDDEN_POISON(), flag_IS_UPS(), flag_LITCIG(), flag_NAT_UPS(), flag_RADIO_MOD(), flag_RADIOSIGNAL_1(), flag_RADIOSIGNAL_2(), flag_RADIOSIGNAL_3(), flag_SILENT(), flag_USE_UPS(), flag_VARSIZE(), flag_WATER_EXTINGUISH(), flag_WET(), item_contents::front(), get_avatar(), get_encumber(), get_sizing(), Character::get_skill_level(), get_var(), goes_bad(), itype::gun, gunmod_find(), gunmods(), has_clothing_mod(), has_fault(), fault::has_flag(), has_flag(), avatar::has_identified(), has_own_flag(), has_var(), human_sized_big_char, human_sized_small_char, is_armor(), is_bionic(), is_book(), is_corpse(), is_craft(), is_engine(), is_favorite, is_filthy(), is_food(), is_fresh(), is_going_bad(), is_gun(), is_magazine(), is_null(), is_tool(), is_wheel(), item_counter, item_vars, itype_barrel_small, itype_blood, itype_id, itype_stock_small, label(), LIQUID, made_of(), nname(), item_contents::num_item_stacks(), pgettext(), cata::hash64_detail::ret, rotten(), silent, skill_survival, small_sized_big_char, small_sized_human_char, string_ends_with(), string_format(), tname(), toolmods(), type, type_name(), typeId(), utf8_truncate(), utf8_width(), volume(), vpgettext(), and itype::wheel.
Referenced by Character::absorb_hit(), advanced_inventory::action_examine(), monexamine::add_armor(), game::add_artifact_dreams(), add_disassemblables(), MapgenRemovePartHandler::add_item_or_charges(), advanced_inventory_pane::add_items_from_area(), auto_pickup::player_settings::add_rule(), add_salvagables(), npc::alt_attack(), ammo_consume(), apply_lock_picking_tool(), apply_prying_tool(), Character::armor_absorb(), iuse::artifact(), inventory::assign_empty_invlet(), mattack::bio_op_disarm(), talk_function::bionic_remove(), Character::block_hit(), Character::block_ranged_hit(), iuse::blood_draw(), iuse::burrow(), activity_handlers::butcher_finish(), camp_car_description(), use_function::can_call(), npc::can_read(), repair_item_actor::can_repair_target(), Character::can_unwield(), Character::can_use(), Character::can_wear(), Character::can_wield(), iuse::capture_monster_act(), iuse::capture_monster_veh(), Character::change_side(), charges_per_volume(), iuse::chew(), iuse::coin_flip(), colorized_item_name(), game_menus::inv::compare(), crafting::complete_disassemble(), npc::confident_gun_mode_range(), Character::consume(), Character::consume_item(), iuse::contacts(), game_menus::inv::container_for(), iuse::craft(), auto_pickup::rule_list::create_rule(), iuse::crowbar(), salvage_actor::cut_up(), damage_item(), deactivate(), item_location::impl::item_in_container::describe(), iexamine::dimensional_portal(), iuse::directional_hologram(), display_money(), display_name(), iuse::dive_tank(), npc::do_reload(), draw_bionics_titlebar(), npc::drop_items(), drop_on_map(), drop_or_embed_projectile(), avatar_action::eat(), Character::eat(), iuse::ehandcuffs(), iuse::einktabletpc(), explosion_handler::emp_blast(), npc::execute_action(), Character::extended_description(), iuse::eyedrops(), Character::feed_furnace_with(), fetch_activity(), activity_handlers::fill_liquid_do_turn(), fill_with(), final_info(), npc::find_item(), heal_actor::finish_using(), ranged::fire_gun(), avatar_action::fire_wielded_weapon(), iuse::firecracker_act(), iexamine::fireplace(), iuse::fishing_rod(), iuse::flumed(), iuse::flusleep(), character_funcs::fmt_wielded_weapon(), Character::fuel_bionic_with(), iexamine::fvat_empty(), iexamine::fvat_full(), activity_handlers::game_do_turn(), iuse::gasmask(), generic_multi_activity_do(), avatar::get_book_reader(), get_continue_reqs(), get_encumber_when_containing(), get_making(), get_next_failure_point(), get_owner_name(), get_property_int64_t(), get_remaining_capacity_for_liquid(), vehicle::get_targeting_npc(), talk_function::give_equipment(), monexamine::give_items_to(), iuse::granade_act(), iuse::gun_repair(), avatar_funcs::gunmod_add(), activity_handlers::gunmod_add_finish(), avatar_funcs::gunmod_remove(), ranged::gunmode_checks_common(), ranged::gunmode_checks_weapon(), iuse::hand_crank(), repair_item_actor::handle_components(), handle_craft_failure(), ranged::handle_gun_damage(), liquid_handler::handle_liquid(), Character::handle_melee_wear(), handle_problematic_pickup(), Character::has_enough_charges(), auto_pickup::player_settings::has_rule(), npc::heal_self(), Character::i_add_to_container(), Character::i_rem(), ideal_ranged_dps(), iuse_transform::info(), info(), Character::invoke_item(), avatar::invoke_item(), advanced_inventory_pane::is_filtered(), Character::item_reload_cost(), npc::item_whitelisted(), iuse::jackhammer(), iexamine::keg(), game::list_items(), aim_activity_actor::load_RAS_weapon(), iuse::magic_8_ball(), marloss_common(), iuse::marloss_seed(), character_martial_arts::martialart_use_message(), iuse::meditate(), iuse::melatonin_tablet(), Character::melee_special_effects(), activity_handlers::mend_item_finish(), iuse::mind_splicer(), mod_charges(), mod_last_rot_check(), Character::modify_morale(), iuse::molotov_lit(), npc::mug_player(), iuse::multicooker(), Character::mutation_effect(), npc_throw(), on_wield(), iuse::oxygen_bottle(), iuse::pack_item(), target_ui::panel_gun_info(), parse_tags(), petfood(), pick_one_up(), iuse::pickaxe(), iuse::play_game(), avatar_action::plthrow(), iuse::portable_game(), Character::pour_into(), iexamine::pour_into_keg(), npc::pretend_fire(), game::print_items_info(), game::process_artifact(), process_blackpowder_fouling(), process_extinguish(), map::process_fields_in_submap(), process_internal(), process_litcig(), process_tool(), ranged::prompt_select_default_ammo_for(), mattack::pull_metal_weapon(), put_into_vehicle(), item_reload_option::qty(), iuse::radio_mod(), iuse::radiocar(), character_funcs::rate_sleep_spot(), player::reduce_charges(), avatar_action::reload(), bandolier_actor::reload(), reload(), activity_handlers::reload_finish(), remove_radio_mod(), auto_pickup::player_settings::remove_rule(), repair_item_actor::repair(), activity_handlers::repair_item_finish(), iuse::robotcontrol(), map::rotten_item_spawn(), iuse::rpgdie(), examine_item_menu::run(), iuse::seed(), character_funcs::select_ammo(), talk_effect_fun_t::set_bulk_trade_accept(), talk_effect_fun_t::set_consume_item(), set_item_inventory(), set_item_map(), set_item_map_or_vehicle(), set_mtype(), set_next_failure_point(), talk_effect_fun_t::set_u_buy_item(), gun_actor::shoot(), trading_window::show_item_data(), sleep(), smash(), iuse::smoking(), iuse::solarpack(), holster_actor::store(), npc::stow_item(), Character::suffer_from_bad_bionics(), monexamine::take_items_from(), Character::takeoff(), iuse::talking_doll(), tname(), iuse::toggle_heats_food(), tool_info(), iuse::towel_common(), iexamine::tree_maple_tapped(), try_consume(), avatar_funcs::try_disarm_npc(), try_reject_mutagen(), avatar_funcs::try_steal_from_npc(), salvage_actor::try_to_cut_up(), target_ui::uitext_title(), iuse::unfold_generic(), avatar_funcs::unload_item(), iuse::unpack_item(), Character::unwield(), inventory_entry::update_cache(), iuse_transform::use(), countdown_actor::use(), explosion_iuse::use(), unfold_vehicle_iuse::use(), set_transform_iuse::use(), change_scent_iuse::use(), deploy_furn_actor::use(), reveal_map_actor::use(), firestarter_actor::use(), inscribe_actor::use(), holster_actor::use(), ammobelt_actor::use(), heal_actor::use(), place_trap_actor::use(), deploy_tent_actor::use(), saw_barrel_actor::use(), saw_stock_actor::use(), unpack_actor::use(), cast_spell_actor::use(), heal_actor::use_healing_item(), avatar_funcs::use_item(), npc::use_painkiller(), iuse::vibe(), activity_handlers::vibe_do_turn(), Character::wear_item(), iuse::weather_tool(), avatar::wield(), avatar_action::wield(), Character::will_eat(), wind_resist(), debug_menu::wishitem(), memorial_logger::write(), and iuse::xanax().
| void item::tool_info | ( | std::vector< iteminfo > & | info, |
| const iteminfo_query * | parts, | ||
| int | batch, | ||
| bool | debug | ||
| ) | const |
Definition at line 3081 of file item.cpp.
References _, ammo_capacity(), ammo_remaining(), ammo_types(), enumerate_as_string(), flag_USES_BIONIC_POWER(), has_flag(), info(), insert_separation_line(), is_tool(), magazine_compatible(), magazine_current(), magazine_integral(), ammunition_type::name(), iteminfo::no_flags, none, string_format(), iteminfo_query::test(), tname(), TOOL_CAPACITY, TOOL_CHARGES, TOOL_MAGAZINE_COMPATIBLE, TOOL_MAGAZINE_CURRENT, and vgettext().
Referenced by info().
| std::vector< item * > item::toolmods | ( | ) |
Returns all toolmods currently attached to this item (always empty if item not a tool)
Definition at line 5449 of file item.cpp.
References item_contents::all_items_top(), contents, and is_tool().
Referenced by ammo_capacity(), ammo_data(), ammo_types(), contents_info(), has_flag(), magazine_compatible(), magazine_default(), magazine_integral(), iuse::remove_all_mods(), tname(), and iuse::toolmod_attach().
| std::vector< const item * > item::toolmods | ( | ) | const |
Definition at line 5462 of file item.cpp.
References item_contents::all_items_top(), contents, and is_tool().
| std::string item::type_name | ( | unsigned int | quantity = 1 | ) | const |
Name of the item type (not the item), with proper plural.
This is only special when the item itself has a special name ("name" entry in item_tags) or is a named corpse. It's effectively the same as calling nname with the item type id. Use this when the actual item is not meant, for example "The shovel" instead of "Your shovel". Or "The jacket is too small", when it applies to all jackets, not just the one the character tried to wear).
Definition at line 9851 of file item.cpp.
References COMPONENT_ID, components, conditional_name::condition, itype::conditional_names, corpse, corpse_name, FLAG, flag_CORPSE(), has_flag(), mtype::id, string_id< T >::is_null(), item_vars, itype_blood, conditional_name::name, itype::nname(), mtype::nname(), num_condition_types, pgettext(), string_format(), translation::translated(), type, conditional_name::type, typeId(), and vpgettext().
Referenced by advanced_inventory::action_examine(), Character::can_wear(), game_menus::inv::compare(), avatar::do_read(), talk_function::field_harvest(), activity_handlers::fill_liquid_do_turn(), npc::finish_read(), character_funcs::fmt_wielded_weapon(), trading_window::get_var_trade(), Character::is_snuggling(), inscribe_actor::item_inscription(), label(), game::list_items(), Character::pour_into(), avatar::read(), bandolier_actor::reload(), game_menus::inv::repair(), examine_item_menu::run(), trading_window::show_item_data(), skim_book_msg(), Character::suffer_from_schizophrenia(), tname(), consume_drug_iuse::use(), place_monster_iuse::use(), and bandolier_actor::use().
| const itype_id & item::typeId | ( | ) | const |
return the unique identifier of the items underlying type
Definition at line 8358 of file item.cpp.
References itype::get_id(), string_id< itype >::NULL_ID(), and type.
Referenced by computer_session::action_blood_anal(), computer_session::action_data_anal(), add_disassemblables(), inventory::add_item_by_items_type_cache(), map::add_item_or_charges(), add_rain_to_container(), item_pricing::adjust_values(), vehicle_part::ammo_current(), ammo_set(), amount_of_internal(), armor_fit_info(), inventory::assign_empty_invlet(), iexamine::autodoc(), basic_info(), iuse::bell(), mattack::bio_op_takedown(), book_info(), Character::can_fuel_bionic_with(), vehicle_part::can_reload(), bandolier_actor::can_store(), Character::can_use_heal_item(), Character::can_wear(), Character::can_wield(), color_in_inventory(), combat_info(), crafting::complete_disassemble(), Character::compute_nutrient_range(), prepared_item_consumption::consume(), vehicle_part::consume_energy(), consumption_event::consumption_event(), mattack::copbot(), map::create_burnproducts(), iuse::directional_antenna(), disassembly_info(), Character::dismount(), iuse::dive_tank(), avatar::do_read(), npc::do_reload(), anonymous_namespace{iexamine.cpp}::atm_menu::do_transfer_all_money(), editmap::draw_main_ui_overlay(), iuse::ecig(), iuse::ehandcuffs(), explosion_handler::emp_blast(), computer_session::failure_destroy_blood(), computer_session::failure_destroy_data(), farm_valid_seed(), fetch_activity(), talk_function::field_harvest(), talk_function::field_plant(), activity_handlers::fill_liquid_do_turn(), fill_with(), final_info(), character_funcs::find_ammo_helper(), iexamine::fireplace(), food_info(), Character::fuel_bionic_with(), Character::fun_for(), iexamine::fvat_empty(), iuse::geiger(), json_talk_topic::gen_responses(), generic_multi_activity_do(), Character::get_acquirable_energy(), inventory::get_binned_items(), Character::get_bionic_fueled_with(), character_funcs::get_book_fun_for(), read_inventory_preset::get_denial(), bionic_install_preset::get_failure_chance(), Character::get_overlay_ids(), disassemble_inventory_preset::get_recipe(), get_remaining_capacity_for_liquid(), json_item_substitution::get_substitution(), get_uncraft_components(), give_item_to(), mattack::grab(), iuse::granade_act(), Character::has_active_item(), inventory::has_enough_painkiller(), Character::i_add(), Character::i_add_to_container(), monster::init_from_item(), init_memory_card_with_random_stuff(), io(), advanced_inv_area::is_container_valid(), character_funcs::is_fun_to_read(), is_funnel_container(), is_gunmod_compatible(), read_inventory_preset::is_known(), is_null(), is_reloadable_helper(), ma_requirements::is_valid_character(), item(), Character::item_handling_cost(), iexamine::keg(), ma_style_callback::key(), aim_activity_actor::load_RAS_weapon(), iuse::lumber(), iuse::marloss(), iuse::marloss_gel(), iuse::marloss_seed(), to_cbc_migration::migration_required(), iuse::mind_splicer(), Item_modifier::modify(), advanced_inventory::move_content(), iuse::mp3(), iuse::mp3_on(), item_stack::only_item(), iuse::pack_cbm(), iuse::pack_item(), iexamine::pedestal_temple(), iexamine::pedestal_wyrm(), peek_related_recipe(), pick_usb(), avatar_action::plthrow(), iexamine::pour_into_keg(), process_extinguish(), process_litcig(), examine_item_menu::rate_action_disassemble(), examine_item_menu::rate_action_read(), avatar::read(), game_menus::inv::reassign_letter(), reload(), activity_handlers::reload_finish(), repair_item_actor::repair_recipe_difficulty(), mattack::riotbot(), iuse::rm13armor_off(), iuse::rm13armor_on(), advanced_inv_area::set_container(), talk_effect_fun_t::set_remove_item_with(), player_morale::set_worn(), iuse::smoking(), iuse::solarpack(), iuse::solarpack_off(), Character::suffer_from_bad_bionics(), Character::suffer_from_radiation(), iuse::talking_doll(), tname(), iuse::toolmod_attach(), toolweapon_off(), toolweapon_on(), iuse::towel_common(), npc_trading::transfer_items(), iexamine::tree_maple_tapped(), disassemble_activity_actor::try_start_single(), salvage_actor::try_to_cut_up(), character_funcs::try_wield_contents(), type_name(), iuse::unpack_item(), inventory::update_cache_with_item(), inventory::update_invlet(), unfold_vehicle_iuse::use(), musical_instrument_actor::use(), unpack_actor::use(), use_amount_internal(), map::use_amount_square(), Character::use_charges(), map::use_charges(), avatar_funcs::use_item(), vehicle::use_washing_machine(), npc::value(), vehicle_part::vehicle_part(), volume(), iuse::water_purifier(), martialart::weapon_valid(), Character::wear_item(), iuse::weather_tool(), avatar::wield(), npc::wield_better_weapon(), and wind_resist().
| int item::units_remaining | ( | const Character & | ch, |
| int | limit = INT_MAX |
||
| ) | const |
How many units (ammo or charges) are remaining?
| ch | character responsible for invoking the item |
| limit | stop searching after this many units found |
Definition at line 7992 of file item.cpp.
References ammo_remaining(), character_funcs::can_interface_armor(), charges, visitable< T >::charges_of(), count_by_charges(), flag_USE_UPS(), has_flag(), is_power_armor(), itype_bio_armor, and itype_UPS.
Referenced by iuse::portable_game(), units_sufficient(), iuse_transform::use(), and set_transform_iuse::use().
| bool item::units_sufficient | ( | const Character & | ch, |
| int | qty = -1 |
||
| ) | const |
Check if item has sufficient units (ammo or charges) remaining.
| ch | Character to check (used if ammo is UPS charges) |
| qty | units required, if unspecified use item default |
Definition at line 8015 of file item.cpp.
References ammo_required(), count_by_charges(), and units_remaining().
Referenced by cauterize_actor::can_use(), iuse::gun_repair(), iuse::mp3(), iuse::multicooker(), iuse::noise_emitter_off(), iuse::radglove(), iuse::radio_off(), iuse::radiocontrol(), iuse::remoteveh(), activity_handlers::repair_item_finish(), iuse::robotcontrol(), iuse::shocktonfa_off(), iuse::shocktonfa_on(), iuse::talking_doll(), iuse::tazer(), toolweapon_off(), toolweapon_on(), iuse::vibe(), and iuse::water_purifier().
| item & item::unset_flag | ( | const std::string & | flag | ) |
Idempotent filter removing an item specific flag.
Definition at line 5338 of file item.cpp.
References cata::flat_set< T, Compare, Data >::erase(), and item_tags.
Referenced by complete_craft(), iuse::ehandcuffs(), explosion_handler::emp_blast(), inherit_flags(), item(), explosion_handler::ExplosionProcess::move_entity(), process_wet(), vehicle_part::properties_to_item(), remove_radio_mod(), repair_item_actor::repair(), and sew_advanced_actor::use().
| void item::unset_flags | ( | ) |
Removes all item specific flags.
Definition at line 5288 of file item.cpp.
References item_tags.
Referenced by iuse::camera(), einkpc_download_memory_card(), and iuse::einktabletpc().
| void item::update_clothing_mod_val | ( | ) |
Definition at line 10150 of file item.cpp.
References clothing_mods::all_clothing_mod_types, CLOTHING_MOD_VAR_PREFIX(), clothing_mods::get_all_with(), has_own_flag(), set_var(), clothing_mods::string_from_clothing_mod_type(), and type.
Referenced by sew_advanced_actor::use().
| bool item::use_amount | ( | const itype_id & | it, |
| int & | quantity, | ||
| std::list< item > & | used, | ||
| const std::function< bool(const item &)> & | filter = return_true<item> |
||
| ) |
Consume a specific amount of items of a specific type.
This includes this item, and any of its contents (recursively).
| it | Type of consumable item. |
| quantity | How much to consumed. |
| used | On success all consumed items will be stored here. |
| filter | Must return true for use to occur. |
Definition at line 8496 of file item.cpp.
References a, NEXT, on_contents_changed(), visitable< item >::remove_item(), use_amount_internal(), and visitable< item >::visit_items().
|
private |
| bool item::use_charges | ( | const itype_id & | what, |
| int & | qty, | ||
| std::list< item > & | used, | ||
| const tripoint & | pos, | ||
| const std::function< bool(const item &)> & | filter = return_true<item> |
||
| ) |
Consumes specified charges (or fewer) from this and any contained items.
| what | specific type of charge required, e.g. 'battery' |
| qty | maximum charges to consume. On return set to number of charges not found (or zero) |
| used | filled with duplicates of each item that provided consumed charges |
| pos | position at which the charges are being consumed |
| filter | Must return true for use to occur. |
Definition at line 8616 of file item.cpp.
References ABORT, count_by_charges(), is_tool(), NEXT, SKIP, and visitable< item >::visit_items().
Referenced by Character::use_charges(), and use_charges_from_furn().
| void item::validate_ownership | ( | ) | const |
Definition at line 1291 of file item.cpp.
References g, string_id< T >::is_null(), old_owner, owner, remove_old_owner(), and remove_owner().
Referenced by get_old_owner(), and get_owner().
| units::volume item::volume | ( | bool | integral = false | ) | const |
Total volume of an item accounting for all contained/integrated items NOTE: Result is rounded up to next nearest milliliter when working with stackable (count_by_charges) items that have fractional volume per charge.
If trying to determine how many of an item can fit in a given space, charges_per_volume should be used instead.
| integral | if true return effective volume if this item was integrated into another |
Definition at line 5104 of file item.cpp.
References charges, components, contents, corpse, corpse_volume(), count_by_charges(), debugmsg, flag_COLLAPSIBLE_STOCK(), get_var(), itype::gun, gunmod_find(), gunmods(), has_flag(), itype::integral_volume, is_corpse(), is_craft(), is_gun(), is_null(), item_contents::item_size_modifier(), itype_barrel_small, units::legacy_volume_factor, LIQUID, made_of(), magazine_current(), itype::magazine_well, num, cata::hash64_detail::ret, itype::rigid, itype::stack_size, type, typeId(), volume(), and itype::volume.
Referenced by activity_on_turn_move_loot(), map::add_item_or_charges(), ranged::aim_cap_from_volume(), attack_cost(), basic_info(), veh_interact::calc_overview(), holster_actor::can_holster(), charges_per_volume(), comestible_inventory_preset::comestible_inventory_preset(), vehicle_part::consume_energy(), salvage_actor::cut_up(), Character::deal_damage(), npc::drop_items(), drop_or_embed_projectile(), fetch_activity(), iexamine::fvat_empty(), Character::get_acquirable_energy(), get_encumber_when_containing(), ranged::get_weapon_dispersion(), monexamine::give_items_to(), repair_item_actor::handle_components(), Character::item_handling_cost(), mdeath::jabberwock(), iexamine::keg(), Character::melee_special_effects(), move_cost_cart(), move_cost_inv(), iexamine::nanofab(), npc_pickup_from_stack(), pickup::obtain_and_tokenize_items(), Character::on_dodge(), on_wield(), vehicle::operate_scoop(), pick_one_up(), pickup::pick_up(), iexamine::pour_into_keg(), Character::power_rating(), process_corpse(), iuse::radiocar(), ready_to_revive(), pickup::reorder_for_dropping(), item_pricing::set_values(), npc::shop_restock(), smash(), holster_actor::store(), npc::stow_item(), stumble(), Character::takeoff(), ranged::throw_item(), Character::throw_range(), ranged::throwing_dispersion(), salvage_actor::time_to_cut_up(), tname(), salvage_actor::try_to_cut_up(), Character::update_bodytemp(), salvage_actor::valid_to_cut_up(), volume(), inventory::volume_without(), and wash_items().
| units::mass item::weight | ( | bool | include_contents = true, |
| bool | integral = false |
||
| ) | const |
Definition at line 4958 of file item.cpp.
References ammo_current(), ammo_data(), ammo_remaining(), ammo_types(), b, charges, components, contents, corpse, count_by_charges(), flag_FIELD_DRESS(), flag_FIELD_DRESS_FAILED(), flag_GIBBED(), flag_NO_DROP(), flag_QUARTERED(), flag_REDUCED_WEIGHT(), flag_SKINNED(), units::from_gram(), units::from_milligram(), get_var(), itype::gun, gunmod_find(), gunmods(), has_flag(), itype::integral_weight, is_corpse(), is_craft(), is_gun(), is_magazine(), is_null(), item_contents::item_weight_modifier(), itype_barrel_small, itype_plut_cell, itype::magazine, magazine_current(), magazine_integral(), PLUTONIUM_CHARGES, cata::hash64_detail::ret, units::to_milliliter(), type, units::quantity< V, U >::value(), itype::volume, weight(), itype::weight, and mtype::weight.
Referenced by monexamine::add_armor(), attack_cost(), basic_info(), can_do_activity_there(), holster_actor::can_holster(), Character::can_pick_weight(), veh_interact::can_remove_part(), pickup::cost_to_move_item(), npc::drop_items(), fetch_activity(), funnel_charges_per_turn(), Character::get_acquirable_energy(), Character::get_weight(), monexamine::give_items_to(), is_two_handed(), lift_strength(), Character::melee_attack(), npc_pickup_from_stack(), pick_one_up(), pickup::pick_up(), advanced_inventory::query_charges(), iuse::radiocar(), item_pricing::set_values(), smash(), holster_actor::store(), stumble(), ranged::throw_item(), Character::throw_range(), ranged::throwing_dispersion(), trap::triggered_by_item(), veh_interact::update_part_requirements(), weight(), Character::weight_carried_reduced_by(), and inventory::weight_without().
| int item::wheel_area | ( | ) | const |
Returns the total area of this wheel or 0 if it isn't one.
Definition at line 6811 of file item.cpp.
References is_wheel(), type, and itype::wheel.
| bool item::will_explode_in_fire | ( | ) | const |
Definition at line 8734 of file item.cpp.
References itype::ammo, itype::explode_in_fire, visitable< item >::has_item_with(), is_magazine(), itype::magazine, type, and will_explode_in_fire().
Referenced by will_explode_in_fire().
| int item::wind_resist | ( | ) | const |
How resistant clothes made of this material are to wind (0-100)
Definition at line 6780 of file item.cpp.
References debugmsg, made_of_types(), tname(), and typeId().
Referenced by wind_resistance_from_item_list().
| safe_reference<Character> item::activated_by |
Definition at line 2242 of file item.h.
Referenced by detonate(), itype::invoke(), and explosion_iuse::use().
| bool item::active = false |
Definition at line 2241 of file item.h.
Referenced by activate(), Character::activate_bionic(), map::add_item(), npc::alt_attack(), iexamine::autodoc(), basic_info(), burn(), iuse::c4(), iuse::cable_attach(), holster_actor::can_holster(), countdown_actor::can_use(), check_litcig(), color_in_inventory(), Character::consume_remote_fuel(), deactivate(), mdeath::detonate(), iuse::dive_tank(), iuse::ehandcuffs(), iuse::einktabletpc(), explosion_handler::emp_blast(), Character::find_remote_fuel(), iuse::firecracker(), iuse::firecracker_pack(), iuse::fish_trap(), iuse::gasmask(), iuse::geiger(), iuse::granade(), Character::has_active_item(), io(), enchantment::is_active(), item(), mattack::kamikaze(), make_gun_projectile(), activity_handlers::make_zlave_finish(), iuse::mininuke(), iuse::molotov_lit(), iuse::mp3(), iuse::mp3_on(), iuse::multicooker(), needs_processing(), iuse::noise_emitter_off(), iuse::noise_emitter_on(), on_takeoff(), on_wear(), iuse::pack_item(), process_extinguish(), process_internal(), process_litcig(), process_tool(), process_UPS(), process_wet(), vehicle_part::properties_to_item(), iuse::radio_off(), iuse::radio_on(), iuse::radiocar(), iuse::radiocaron(), iuse::radiocontrol(), read(), iuse::remoteveh(), reset_cable(), mattack::riotbot(), iuse::rm13armor_off(), iuse::rm13armor_on(), iuse::shocktonfa_off(), iuse::shocktonfa_on(), sleep(), iuse::smoking(), iuse::solarpack_off(), stacks_with(), holster_actor::store(), ranged::throw_item(), iuse::throwable_extinguisher_act(), tname(), toolweapon_off(), toolweapon_on(), iuse::tow_attach(), iuse::towel_common(), avatar_funcs::unload_item(), iuse::unpack_item(), iuse_transform::use(), countdown_actor::use(), fireweapon_off_actor::use(), musical_instrument_actor::use(), and npc::value().
|
private |
Definition at line 2173 of file item.h.
Referenced by get_safe_reference().
|
private |
The time the item was created.
Definition at line 2231 of file item.h.
Referenced by birthday(), io(), item(), legacy_fast_forward_time(), and set_birthday().
| int item::burnt = 0 |
Definition at line 2207 of file item.h.
Referenced by basic_info(), burn(), editmap::edit_itm(), monster::init_from_item(), io(), process_corpse(), ready_to_revive(), stacks_with(), and tname().
| int item::charges |
Definition at line 2203 of file item.h.
Referenced by iuse::acidbomb_act(), act_vehicle_siphon(), Character::activate_bionic(), activity_on_turn_wear(), vehicle::add_charges(), vehicle::add_item(), map::add_item_or_charges(), avatar_funcs::add_or_drop_with_msg(), add_rain_to_container(), ammo_consume(), vehicle_part::ammo_consume(), ammo_remaining(), vehicle_part::ammo_remaining(), ammo_set(), ammo_unset(), item_stack::amount_can_fit(), jmapgen_liquid_item::apply(), are_requirements_nearby(), iuse::arrow_flammable(), basic_info(), burn(), iuse::c4(), bandolier_actor::can_store(), fireweapon_off_actor::can_use(), manualnoise_actor::can_use(), comestible_inventory_preset::comestible_inventory_preset(), complete_craft(), crafting::complete_disassemble(), veh_interact::complete_vehicle(), Character::consume_charges(), vehicle_part::consume_energy(), Character::consume_item(), liquid_handler::consume_liquid(), Character::consume_med(), game_menus::inv::container_for(), count(), activity_handlers::craft_do_turn(), recipe::create_byproducts(), recipe::create_result(), recipe::create_results(), detonate(), mdeath::detonate(), display_name(), iuse::dive_tank(), anonymous_namespace{iexamine.cpp}::atm_menu::do_purchase_card(), npc::do_reload(), veh_interact::do_siphon(), anonymous_namespace{iexamine.cpp}::atm_menu::do_transfer_all_money(), move_items_activity_actor::do_turn(), throw_activity_actor::do_turn(), anonymous_namespace{iexamine.cpp}::atm_menu::do_withdraw_money(), map::draw_lab(), iuse::ehandcuffs(), explosion_handler::emp_blast(), iuse::eyedrops(), farm_action(), Character::feed_furnace_with(), fetch_activity(), talk_function::field_harvest(), activity_handlers::fill_liquid_do_turn(), fill_with(), final_info(), wash_activity_actor::finish(), heal_actor::finish_using(), iuse::firecracker(), iuse::firecracker_act(), iuse::firecracker_pack(), iuse::firecracker_pack_act(), iuse::fish_trap(), character_funcs::fmt_wielded_weapon(), food_info(), for_each_item_in_both(), inventory::form_from_map(), Character::fuel_bionic_with(), funnel_charges_per_turn(), iexamine::fvat_empty(), iexamine::fvat_full(), iuse::gasmask(), Character::get_acquirable_energy(), activity_handlers::repair_activity_hack::anonymous_namespace{activity_handlers.cpp}::get_fake_tool(), iexamine::get_harvest_items(), liquid_handler::get_liquid_target(), get_remaining_capacity_for_liquid(), inventory_entry::get_selected_charges(), json_item_substitution::get_substitution(), monexamine::give_items_to(), iuse::granade(), iuse::granade_act(), iuse::grenade_inc_act(), hackveh(), liquid_handler::handle_all_liquid(), liquid_handler::handle_liquid_from_container(), pickup::handle_spillable_contents(), has_infinite_charges(), Character::i_add_to_container(), io(), item(), Character::item_reload_cost(), iexamine::keg(), med_info(), merge_charges(), Item_factory::migrate_item(), activity_handlers::milk_finish(), iuse::mininuke(), mod_charges(), mod_damage(), Item_modifier::modify(), iuse::molotov_lit(), advanced_inventory::move_all_items(), advanced_inventory::move_content(), move_item(), iuse::multicooker(), npc_throw(), vehicle::operate_planter(), operator<(), parse_tags(), iexamine::pay_gas(), liquid_handler::perform_liquid_transfer(), pick_one_up(), pickup::pick_up(), map::place_gas_pump(), map::place_toilet(), Character::pour_into(), iexamine::pour_into_keg(), advanced_inventory::print_items(), game::process_artifact(), process_cable(), Character::process_items(), relic_funcs::process_recharge_entry(), map::produce_sap(), vehicle_part::properties_to_item(), item_reload_option::qty(), advanced_inventory::query_charges(), player::reduce_charges(), bandolier_actor::reload(), reload(), remove_ammo(), reset_cable(), mattack::riotbot(), talk_effect_fun_t::set_bulk_trade_accept(), set_countdown(), iexamine::sign(), character_funcs::siphon(), smoker_activate(), map::spawn_an_item(), spell_effect::spawn_ethereal_item(), split(), stacks_with(), Character::suffer_from_bad_bionics(), iuse::tazer2(), Character::throw_range(), iuse::throwable_extinguisher_act(), ranged::throwing_dispersion(), tname(), npc_trading::trade(), npc_trading::transfer_items(), iexamine::tree_maple_tapped(), try_consume(), try_fuel_fire(), units_remaining(), avatar_funcs::unload_item(), inventory::update_quality_cache(), explosion_iuse::use(), place_monster_iuse::use(), fireweapon_off_actor::use(), fireweapon_on_actor::use(), manualnoise_actor::use(), bandolier_actor::use(), emit_actor::use(), sew_advanced_actor::use(), basecamp::use_charges(), map::use_charges(), use_charges_from_furn(), iexamine::use_furn_fake_item(), volume(), iuse::water_purifier(), weight(), Character::weight_carried_reduced_by(), debug_menu::wishitem(), and memorial_logger::write().
| std::list<item> item::components |
Definition at line 2166 of file item.h.
Referenced by base_volume(), activity_handlers::butcher_finish(), complete_craft(), crafting::complete_disassemble(), component_info(), components_to_string(), Character::compute_effective_nutrients(), disassembly_info(), get_continue_reqs(), get_uncraft_components(), handle_craft_failure(), Character::handle_melee_wear(), io(), item(), make_component_hash(), game::revive_corpse(), set_flag_recursive(), stacks_with(), type_name(), volume(), and weight().
| item_contents item::contents |
Definition at line 2165 of file item.h.
Referenced by Character::absorb_hit(), act_vehicle_siphon(), computer_session::action_blood_anal(), computer_session::action_data_anal(), actualize_rot(), vehicle::add_item(), add_rain_to_container(), allow_crafting_component(), ammo_consume(), vehicle_part::ammo_consume(), vehicle_part::ammo_current(), ammo_data(), ammo_remaining(), vehicle_part::ammo_remaining(), vehicle_part::ammo_set(), ammo_unset(), vehicle_part::ammo_unset(), map::bash_items(), iuse::blood_draw(), activity_handlers::butcher_finish(), item_location::impl::item_in_container::calc_index(), veh_interact::calc_overview(), item_funcs::can_be_unloaded(), Character::can_consume(), can_holster(), bandolier_actor::can_store(), can_unload_liquid(), casings_handle(), complete_craft(), veh_interact::complete_vehicle(), Character::compute_nutrient_range(), Character::consume(), npc::consume_cbm_items(), vehicle_part::consume_energy(), contents_info(), contents_made_of(), salvage_actor::cut_up(), damage_item(), item_location::deserialize(), deserialize(), detonate(), display_name(), veh_interact::do_siphon(), avatar_action::eat(), empty_buckets(), computer_session::failure_destroy_blood(), computer_session::failure_destroy_data(), fill_with(), final_info(), character_funcs::find_ammo_helper(), character_funcs::fmt_wielded_weapon(), get_category(), Character::get_consumable_from(), get_contained(), get_encumber(), get_free_mod_locations(), liquid_handler::get_liquid_target(), get_quality(), get_remaining_capacity_for_liquid(), json_item_substitution::get_substitution(), trading_window::get_var_trade(), goes_bad_after_opening(), gunmods(), liquid_handler::handle_liquid_from_container(), Character::handle_melee_wear(), handle_problematic_pickup(), pickup::handle_spillable_contents(), has_effect_when_carried(), Character::i_add_to_container(), info(), is_ammo_container(), is_container_empty(), is_container_full(), advanced_inv_area::is_container_valid(), is_dangerous(), is_food_container(), is_funnel_container(), is_med_container(), is_reloadable_helper(), item_has_uses_recursive(), Character::item_reload_cost(), magazine_current(), item_location::impl::item_in_container::make_dirty(), Character::melee_special_effects(), Item_factory::migrate_item(), activity_handlers::mind_splicer_finish(), advanced_inventory::move_content(), iuse::multicooker(), needs_processing(), on_pickup(), operator<(), peek_related_recipe(), put_in(), item_reload_option::qty(), qualities_info(), iuse::radiocar(), avatar_action::reload(), bandolier_actor::reload(), reload(), item_contents::remove_internal(), visitable< T >::remove_items_with(), character_funcs::select_ammo(), serialize(), advanced_inv_area::set_container(), map::smash_items(), spill_contents(), spoilage_sort_order(), stacks_with(), tname(), toolmods(), iexamine::tree_maple_tapped(), try_consume(), salvage_actor::try_to_cut_up(), character_funcs::try_wield_contents(), avatar_funcs::unload_item(), item_location::impl::item_in_container::unpack(), holster_actor::use(), bandolier_actor::use(), salvage_actor::valid_to_cut_up(), visit_internal(), volume(), iuse::water_purifier(), weight(), avatar::wield(), avatar_action::wield(), npc::wield_better_weapon(), and memorial_logger::write().
|
private |
Definition at line 2176 of file item.h.
Referenced by base_volume(), burn(), can_revive(), color(), corpse_volume(), food_info(), get_mtype(), io(), is_corpse(), is_tainted(), item(), made_of(), process_corpse(), set_mtype(), stacks_with(), type_name(), volume(), and weight().
|
private |
Definition at line 2177 of file item.h.
Referenced by get_corpse_name(), io(), and type_name().
|
private |
Definition at line 2198 of file item.h.
Referenced by basic_info(), get_cached_tool_selections(), get_comestible(), get_continue_reqs(), get_making(), get_next_failure_point(), has_tools_to_continue(), io(), is_craft(), is_food_container(), item(), set_cached_tool_selections(), set_next_failure_point(), set_tools_to_continue(), stacks_with(), and tname().
|
private |
Definition at line 2174 of file item.h.
Referenced by ammo_consume(), ammo_data(), ammo_set(), ammo_unset(), gun_info(), io(), and reload().
|
private |
Definition at line 2236 of file item.h.
Referenced by basic_info(), damage(), damage_level(), io(), mod_damage(), on_damage(), set_damage(), and stacks_with().
| pimpl<item_drop_token> item::drop_token |
Two items are dropped in same "batch" if they have identical drop tokens Ideally, this would be stored outside item class.
Definition at line 2254 of file item.h.
Referenced by pickup::obtain_and_tokenize_items(), and pickup::optimize_pickup().
| bool item::encumbrance_update_ = false |
Definition at line 2219 of file item.h.
Referenced by on_contents_changed().
| units::energy item::energy |
Definition at line 2204 of file item.h.
Referenced by energy_remaining(), io(), mod_energy(), and process_tool().
| std::set<fault_id> item::faults |
What faults (if any) currently apply to this item.
Definition at line 2168 of file item.h.
Referenced by butcher_cbm_item(), clear_faults(), vehicle_part::fault_set(), vehicle_part::faults(), final_info(), ranged::fire_gun(), ranged::handle_gun_damage(), has_fault(), io(), is_faulty(), activity_handlers::mend_item_finish(), Item_modifier::modify(), Character::perform_uninstall(), Character::place_corpse(), process_internal(), examine_item_menu::rate_action_mend(), stacks_with(), tname(), and Character::uninstall_bionic().
| int item::frequency = 0 |
Definition at line 2209 of file item.h.
Referenced by io(), and iuse::radio_on().
|
static |
Definition at line 2162 of file item.h.
Referenced by character_funcs::ammo_count_for(), charges_per_volume(), itype::charges_per_volume(), iexamine::clean_water_source(), activity_handlers::fill_liquid_do_turn(), has_infinite_charges(), merge_charges(), mod_charges(), vehicle::print_fuel_indicator(), player::select_item_component(), item_funcs::shots_remaining(), item_comp::to_string(), and map::water_from().
| char item::invlet = 0 |
Definition at line 2240 of file item.h.
Referenced by Character::activate_bionic(), inventory::add_item(), inventory::add_item_by_items_type_cache(), Character::allocated_invlets(), inventory::assign_empty_invlet(), Character::consume(), inventory_entry::get_invlet(), Character::i_add(), in_container(), tutorial_game::init(), Character::invlet_to_item(), io(), pick_one_up(), inventory::reassign_item(), game_menus::inv::reassign_letter(), inventory::restack(), set_item_inventory(), show_armor_layers_ui(), inventory_selector_preset::sort_compare(), inventory::update_cache_with_item(), inventory::update_invlet(), and memorial_logger::write().
| int item::irradiation = 0 |
Definition at line 2211 of file item.h.
Referenced by armor_fit_info(), and io().
| bool item::is_favorite = false |
Definition at line 2243 of file item.h.
Referenced by activity_on_turn_move_loot(), inventory::assign_empty_invlet(), color_in_inventory(), advanced_inventory::display(), inventory_drop_selector::execute(), Character::feed_furnace_with(), io(), advanced_inventory::move_all_items(), inventory_column::on_input(), game_menus::inv::prompt_reassign_letter(), examine_item_menu::run(), set_favorite(), inventory_column::set_stack_favorite(), stacks_with(), and tname().
| int item::item_counter = 0 |
Definition at line 2212 of file item.h.
Referenced by activate(), basic_info(), handle_craft_failure(), io(), item(), merge_charges(), process_fake_mill(), process_fake_smoke(), process_internal(), process_litcig(), process_wet(), set_next_failure_point(), iuse::smoking(), tname(), iuse::towel_common(), iuse_transform::use(), and countdown_actor::use().
| FlagsSetType item::item_tags |
Definition at line 2171 of file item.h.
Referenced by basic_info(), wash_activity_actor::finish(), inventory::form_from_map(), get_comestible_fun(), get_flags(), has_own_flag(), inherit_flags(), io(), set_flag(), stacks_with(), iuse::toggle_heats_food(), unset_flag(), unset_flags(), and debug_menu::wishitem().
|
private |
Definition at line 2175 of file item.h.
Referenced by already_used_by_player(), basic_info(), clear_vars(), erase_var(), final_info(), get_var(), has_var(), io(), mark_as_used_by_player(), set_var(), stacks_with(), tname(), and type_name().
|
private |
Time when the rot calculation was last performed.
Definition at line 2229 of file item.h.
Referenced by basic_info(), calc_rot(), io(), item(), legacy_fast_forward_time(), mod_last_rot_check(), process(), process_rot(), and set_relative_rot().
|
private |
Definition at line 2237 of file item.h.
Referenced by getlight(), io(), and is_emissive().
| int item::mission_id = -1 |
Definition at line 2213 of file item.h.
Referenced by computer_session::action_download_software(), io(), submap::load(), and Character::has_mission_item_filter::operator()().
|
mutableprivate |
Definition at line 2235 of file item.h.
Referenced by vehicle::deserialize(), get_old_owner(), io(), vehicle::serialize(), and validate_ownership().
|
mutableprivate |
Definition at line 2233 of file item.h.
Referenced by basic_info(), bonus_from_enchantments(), vehicle::deserialize(), get_owner(), handle_pickup_ownership(), io(), vehicle::serialize(), set_owner(), and validate_ownership().
| int item::player_id = -1 |
Definition at line 2214 of file item.h.
Referenced by mission::deserialize(), io(), and mission::serialize().
| int item::poison = 0 |
Definition at line 2208 of file item.h.
Referenced by add_rain_to_container(), Character::eat(), inherit_flags(), io(), map::produce_sap(), rate_food(), iuse::water_purifier(), and npc::will_accept_from_player().
| int item::recipe_charges = 1 |
Definition at line 2206 of file item.h.
Referenced by complete_craft(), Character::compute_effective_nutrients(), and io().
|
private |
Definition at line 2201 of file item.h.
Referenced by convert(), get_enchantments(), get_relic_recharge_scheme(), io(), is_relic(), item(), mutations_from_wearing(), and stacks_with().
|
private |
Accumulated rot, expressed as time the item has been in standard temperature.
It is compared to shelf life (islot_comestible::spoils) to decide if the item is rotten.
Definition at line 2227 of file item.h.
Referenced by basic_info(), minimum_freshness_duration(), spoilage_sort_order(), and stacks_with().
| snippet_id item::snip_id = snippet_id::NULL_ID() |
Definition at line 2210 of file item.h.
Referenced by basic_info(), io(), item(), and set_snippet().
|
private |
Definition at line 2178 of file item.h.
Referenced by add_technique(), combat_info(), get_techniques(), has_technique(), io(), and stacks_with().
| const itype* item::type |
Definition at line 2164 of file item.h.
Referenced by activate(), npc::activate_item(), actualize_rot(), game::add_artifact_dreams(), map::add_item(), add_monsters(), iuse::adrenaline_injector(), alcohol(), ammo_capacity(), ammo_data(), ammo_default(), ammo_effects(), ammo_required(), ammo_set(), ammo_type(), ammo_types(), iuse::antiasthmatic(), iuse::antibiotic(), iuse::anticonvulsant(), iuse::antifungal(), iuse::antiparasitic(), apply_lock_picking_tool(), armor_info(), armor_protection_info(), iuse::artifact(), iexamine::autodoc(), base_damage_thrown(), base_volume(), basic_info(), battery_info(), iuse::bell(), bionic_info(), talk_function::bionic_install(), iuse::blech(), iuse::blech_because_unclean(), iuse::blood_draw(), iuse::boltcutters(), book_info(), brewing_results(), brewing_time(), mdeath::broken(), burn(), Character::burn_fuel(), iuse::c4(), character_effects::calc_focus_equilibrium(), iuse::call_of_tindalos(), iuse::camera(), item_funcs::can_be_unloaded(), can_contain(), can_do_activity_there(), Character::can_eat(), iuse::can_goo(), can_holster(), npc::can_read(), Character::can_reload(), bandolier_actor::can_store(), fireweapon_off_actor::can_use(), manualnoise_actor::can_use(), install_bionic_actor::can_use(), saw_barrel_actor::can_use_on(), saw_stock_actor::can_use_on(), iuse::capture_monster_act(), charges_per_volume(), check_art_charge_req(), iuse::chew(), iuse::chop_logs(), chop_plank_activity(), iuse::chop_tree(), chop_tree_activity(), iuse::clear_rubble(), color(), color_in_inventory(), combat_info(), common_ammo_default(), prepared_item_consumption::consume(), Character::consume_effects(), Character::consume_med(), iuse::contacts(), contain_monster(), container_info(), convert(), count_by_charges(), activity_handlers::cracking_do_turn(), Character::crit_chance(), iuse::crowbar(), damage_melee(), iuse::datura(), deactivate(), deserialize(), mission::deserialize(), player_morale::morale_point::deserialize(), addiction::deserialize(), vehicle::deserialize(), detonate(), iuse::dig(), iuse::dig_channel(), iuse::directional_antenna(), iuse::directional_hologram(), display_name(), iuse::dive_tank(), avatar::do_read(), iuse::dog_whistle(), game::dump_stats(), Character::eat(), mattack::eat_food(), iuse::ecig(), iuse::ehandcuffs(), iuse::einktabletpc(), emit_radio_signal(), engine_displacement(), Character::enumerate_unmet_requirements(), iuse::extinguisher(), iuse::eyedrops(), faults_potential(), talk_function::field_harvest(), iuse::fill_pit(), final_info(), find_armor_data(), find_best_lock_picking_tool(), npc::find_dangerous_explosives(), npc::finish_read(), heal_actor::finish_using(), avatar_action::fire_wielded_weapon(), iuse::firecracker(), iexamine::fireplace(), iuse::flumed(), iuse::flusleep(), iuse::foodperson(), fuel_energy(), fuel_pump_terrain(), iuse::fungicide(), iuse::gasmask(), iuse::geiger(), json_talk_topic::gen_responses(), Character::get_acquirable_energy(), activatable_inventory_preset::get_action_name(), bionic_install_preset::get_anesth_amount(), bionic_uninstall_preset::get_anesth_amount(), get_available_recipes(), get_base_env_resist(), get_base_env_resist_w_filter(), read_inventory_preset::get_book(), character_funcs::get_book_fun_for(), avatar::get_book_reader(), get_category(), get_chapters(), get_clothing_mod_val(), get_comestible(), get_comestible_fun(), get_container_capacity(), activatable_inventory_preset::get_denial(), read_inventory_preset::get_denial(), bionic_install_preset::get_denial(), bionic_install_surgeon_preset::get_denial(), bionic_uninstall_preset::get_denial(), comestible_inventory_preset::get_edible_comestible(), get_encumber_when_containing(), get_env_resist(), bionic_install_preset::get_failure_chance(), bionic_install_surgeon_preset::get_failure_chance(), bionic_uninstall_preset::get_failure_chance(), ranged::get_fastest_sight(), get_gun_ups_drain(), npc::get_healing_item(), Character::get_hit_weapon(), get_layer(), get_min_str(), get_mod_locations(), ranged::get_most_accurate_sight(), zone_manager::get_near_zone_type_for_item(), bionic_install_preset::get_operation_duration(), bionic_install_surgeon_preset::get_operation_duration(), bionic_uninstall_preset::get_operation_duration(), comestible_inventory_preset::get_order(), get_pet_armor_bodytype(), get_pet_armor_max_vol(), get_pet_armor_min_vol(), get_plant_epoch(), get_plant_name(), get_property_int64_t(), get_property_string(), get_qualities(), get_quality(), get_reload_time(), get_remaining_capacity_for_liquid(), get_storage(), get_techniques(), get_thickness(), get_total_capacity(), get_use_internal(), plot_options::get_zone_name_suggestion(), getGasDiscountCardQuality(), getlight_emit(), goes_bad_after_opening(), iuse::granade(), iuse::granade_act(), gun_damage(), gun_dispersion(), gun_info(), gun_noise(), gun_range(), gun_recoil(), gun_recoil_multiplier(), iuse::gun_repair(), gun_skill(), npc_ai::gun_value(), gunmod_info(), avatar_funcs::gunmod_installation_odds(), iuse::hacksaw(), iuse::hairkit(), iuse::hammer(), iuse::handle_ground_graffiti(), ranged::handle_gun_damage(), has_effect_when_carried(), has_effect_when_wielded(), has_effect_when_worn(), has_explosion_data(), has_flag(), npc::has_healing_options(), has_property(), has_technique(), has_use(), npc::heal_player(), npc::heal_self(), iuse::honeycomb(), in_its_container(), countdown_actor::info(), info(), iuse::inhaler(), inherit_flags(), Character::invoke_item(), avatar::invoke_item(), npc::invoke_item(), io(), is_ammo(), is_artifact(), is_bandolier(), is_battery(), is_bionic(), is_book(), is_brewable(), is_bucket(), is_container(), is_deployable(), is_emissive(), is_engine(), is_fuel(), is_gun(), is_gunmod(), is_holster(), is_magazine(), is_non_resealable_container(), is_null(), avatar_funcs::is_pet_food(), is_seed(), activatable_inventory_preset::is_shown(), is_tool(), is_toolmod(), is_transformable(), is_upgrade(), is_watertight_container(), is_wheel(), item(), item_has_uses_recursive(), Character::item_reload_cost(), item_reload_option::item_reload_option(), iuse::jackhammer(), iuse::jet_injector(), submap::load(), iuse::lumber(), iuse::ma_manual(), made_of(), magazine_compatible(), magazine_default(), magazine_info(), magazine_integral(), iuse::makemound(), mark_chapter_as_read(), iuse::marloss(), iuse::marloss_gel(), iuse::marloss_seed(), max_damage(), iuse::meditate(), Character::meets_requirements(), Character::meets_stat_requirements(), iuse::melatonin_tablet(), npc_ai::melee_value(), iuse::meth(), mill_load_food(), min_damage(), iuse::mind_splicer(), mine_activity(), minimum_freshness_duration(), iuse::mininuke(), mod_damage(), mod_energy(), Item_modifier::modify(), iuse::modify_grid_connections(), Character::modify_morale(), iuse::mop(), avatar_action::move(), iuse::mp3(), iuse::mp3_on(), iuse::multicooker(), mutagen_common_checks(), iuse::mycus(), iuse::noise_emitter_off(), iuse::noise_emitter_on(), on_contents_changed(), on_drop(), on_pickup(), on_takeoff(), on_wear(), on_wield(), operator<(), iuse::oxygen_bottle(), iuse::pheromone(), iuse::plantblech(), iuse::poison(), iuse::portal(), Character::pour_into(), price(), process(), game::process_artifact(), process_cable(), process_extinguish(), process_internal(), Character::process_items(), process_tool(), process_vehicle_items(), process_wet(), vehicle_part::properties_to_item(), iuse::prozac(), iuse::purifier(), iuse::purify_iv(), iuse::purify_smart(), item_reload_option::qty(), qualities_info(), quality_of(), plot_options::query_seed(), iuse::radglove(), iuse::radio_off(), iuse::radio_on(), iuse::radiocar(), iuse::radiocaron(), iuse::radiocontrol(), examine_item_menu::rate_action_use(), rate_food(), read(), avatar::read(), read_inventory_preset::read_inventory_preset(), avatar_action::reload(), reload(), activity_handlers::reload_finish(), iuse::remoteveh(), repair_item_actor::repair_recipe_difficulty(), repaired_with(), reset_cable(), mattack::riotbot(), iuse::rm13armor_off(), iuse::rm13armor_on(), iuse::robotcontrol(), iexamine::safe(), iuse::seed(), mission::serialize(), player_morale::morale_point::serialize(), addiction::serialize(), vehicle::serialize(), iuse::sewage(), iuse::shavekit(), activity_handlers::shear_finish(), iuse::shocktonfa_off(), sight_dispersion(), simulate_burn(), iuse::siphon(), skim_book_msg(), iuse::sleep(), smoker_activate(), iuse::smoking(), activity_handlers::spellcasting_finish(), spoilage_sort_order(), stacks_with(), activity_handlers::start_fire_do_turn(), activity_handlers::start_fire_finish(), npc::start_read(), iuse::stimpack(), iuse::strong_antibiotic(), symbol(), iuse::talking_doll(), iuse::tazer(), iuse::teleport(), iuse::thorazine(), ranged::throw_item(), ranged::time_to_attack(), npc::time_to_read(), avatar::time_to_read(), tname(), iuse::toolmod_attach(), toolweapon_off(), toolweapon_on(), iuse::towel_common(), try_consume(), type_name(), typeId(), avatar_funcs::unload_item(), target_ui::update_ammo_range_from_gun_mode(), update_clothing_mod_val(), charger_tile::update_internal(), iuse_transform::use(), countdown_actor::use(), consume_drug_iuse::use(), pick_lock_actor::use(), firestarter_actor::use(), fireweapon_off_actor::use(), fireweapon_on_actor::use(), manualnoise_actor::use(), heal_actor::use(), mutagen_actor::use(), mutagen_iv_actor::use(), install_bionic_actor::use(), avatar_funcs::use_item(), vehicle::use_monster_capture(), iuse::vaccine(), npc::value(), iuse::vibe(), volume(), iuse::vortex(), iuse::weak_antibiotic(), npc_ai::weapon_value(), iuse::weed_cake(), weight(), wheel_area(), vehicle_part::wheel_diameter(), vehicle_part::wheel_width(), npc::wield_better_weapon(), npc_ai::wielded_value(), npc::will_accept_from_player(), will_explode_in_fire(), and iuse::xanax().